Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 8640 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm trying to find out the number of the current record on a CDML page because I want to compare it with other values (e.g. the content of a token). This can't be done by [something.cn.CurrentRecordNumber] because the expression "CurrentRecordNumber" is only allowed to be the first parameter, not the second one. Switching the parameters will also fail because there's no comparison "is contained by" instead of "contains".

So I defined a field "Line" with the formula "Status(CurrentRecordNumber)" and made it unstored. That calculation works fine on a FileMaker layout. But not on a CDML page!!!!

What I eventually found out is: directly in FileMaker the value of that field is the number of the record *within the current found set*. On a CDML page the same field displays the number of the record *within the whole database*! Both values are different!

Has someone an explanation for this strange behaviour?

Posted

[FMP-CurrentRecordNumber] (within the [FMP-Record] tags) will display the record number resulting from the find, for instance, on the web page. If you have 20 records, the numbers will be 1-20.

Posted

That's right. But I need to compare that value with a token. [FMP-If:CurrentToken.cn.CurrentRecordNumber] won't work because CurrentRecordNumber is not allowed as the second parameter. So I tried [FMP-If:CurrentToken.cn.Field:theNumber] - without success.

Posted

quote:

Originally posted by Rainer:

That's right. But I need to compare that value with a token. [FMP-If:CurrentToken.cn.CurrentRecordNumber] won't work because CurrentRecordNumber is not allowed as the second parameter. So I tried [FMP-If:CurrentToken.cn.Field:theNumber] - without success.

I am using field [FMP-field: id_statrecid] with Record Internal Number. That field (id_statrecid) is holding Status(CurrentRecordID) the true number.

The formula "If:CurrentToken.cn.Field:theNumber] " is not valid.

Posted

Status(CurrentRecordID) works fine, thank you.

But I think different values of the same field are a serious bug and should be corrected by FileMaker.

Posted

There are two functions:

Status(CurrentRecordID)

returns the unique ID of the current record

Status(CurrentRecordNumber)

returns the number of the record in the current found set

They are *not* the same. It sounds like the two are getting mixed up.

The expression "CurrentToken.cn.CurrentRecordNumber" isn't valid with a number -- CurrentRecordNumber is a number. Only eq, gt, or lt (equals, greater than, less than) are valid operators with numbers. Contains (cn) is only for text strings.

Posted

quote:

Status(CurrentRecordID)

returns the unique ID of the current record

Status(CurrentRecordNumber)

returns the number of the record in the current found set

They are *not* the same.

Sorry Vaughan, but this is not the problem I have. In both cases I use CurrentRecordNumber.

Please try this:

1) define a field, let's say "Line", give it the formula "Status(CurrentRecordNumber)"

2) put it on a FileMaker List

3) select some records

You will get 1, 2, 3, 4 ,5 ...

4) put this field on a CDML page: [FMP-Field:Line]

You will get 711, 164, 2418, 13 ... or something else. These are the positions of that records within the database, not within the selection!

Why do I need the line numbers, if there is a CDML expression [CurrentRecordNumber]?

For instance, I want to decide if a line is odd or equal and then swich the colors on every second line. So I tried:

Odd = mod(Status(CurrentRecordNumber);2)

On FileMaker I get 1, 0, 1, 0, 1, 0

On CDML something chaotic!

  • 1 month later...
Posted

Because CurrentRecordNumber refers to the position in the found set. When Web Companion looks at the database it does so as a multi-user and it does not see whatever current found set you see as the host user, it sees all records.

You might have to use an unstored calculation field and a script to do what you want.

  • 4 months later...
  • Newbies
Posted

quote:

Originally posted by Vaughan:

Because CurrentRecordNumber refers to the position in the found set. When Web Companion looks at the database it does so as a multi-user and it does not see whatever current found set you see as the host user, it sees all records.

You might have to use an unstored calculation field and a script to do what you want.

No, this can't be true. Under your hypothesis, if I were to view an unstored calculation field with 'status(CurrentFoundCount)', I should get two different results depending on whether I'm viewing it from within Filemaker or from CDML, just like we're getting with 'status(CurrentRecordNumber)' -- but this isn't the case. For some reason CurrentFoundCount works (ie, Filemaker and CDML agree), but CurrentRecordNumber doesn't.

Are there any other ideas for what's causing this discrepancy? I would also like to get this to work -- but it's starting to sound like a bug to me.

Posted

RE:

Status(CurrentRecordID)

returns the unique ID of the current record

Status(CurrentRecordNumber)

returns the number of the record in the current found set

--------------

As you can see the first Status(CurrentRecordID) is OK for any situation, so do not use the second one Status(CurrentRecordNumber).

This topic is 8640 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.