1 Reply Latest reply on Jun 23, 2009 1:55 PM by TSGal

    Bug when combining GetNthRecord



      Bug when combining GetNthRecord & List

      Description of the issue

      Hi all, I encountered an issue today when trying to combine the List function with GetNthRecord.  My intention was to get a list of the last 10 created record ID's in a particular table. To do this,  I create a relationship to the records in the table (Contacts) - & sorted Descending Order by Record ID. Next,  because of the sort, I intended to use GetNthRecord to obtain the record ID's of the first 10 records:  List (GetNthRecord ( Contacts::RecordID ; 1 ) ;...GetNthRecord ( Contacts::RecordID ; 10 )) the end result was a list of the first record ID 10 times,  ie: 33313331...3331 .  I also tried to split the GetNth's out into a Let statement using let variables, and put the variables into the List function instead, and got the same result. The solution I found was to keep using the let statement, but use local variables instead.  This seemed to resolve the issue.  However I still think this is a bug as I see no reason why Let variables, or even putting GetNthRecord directly in the List function, shouldn't work. The working version looked like this: Let ([$One = GetNthRecord ( Contacts::RecordID ; 1 ) ;...$Ten = GetNthRecord ( Contacts::RecordID ; 10];List ( $One ; ... ; $Ten ))  Issue is both in FileMaker 9 & 10,  I am running on OS X 10.5 Intel. 

        • 1. Re: Bug when combining GetNthRecord & List



          Thank you for your post, and I apologize for the late reply.


          From the "List" function in Help...

          "Note: When referencing multiple repeating fields, List() returns the list of values across the first repetition in the calculation's first repetition, then the list of values across the second repetition in the second repetition, and so on."


          As you have discovered, your workaround is a viable solution.



          FileMaker, Inc.