November 22, 200025 yr 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?
November 22, 200025 yr [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.
November 23, 200025 yr Author 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.
November 23, 200025 yr 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.
November 23, 200025 yr Author 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.
November 24, 200025 yr 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.
November 24, 200025 yr Author 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!
January 7, 200125 yr 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.
June 5, 200124 yr Newbies 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.
June 6, 200124 yr 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).
Create an account or sign in to comment