GetNthRecord, used in Script Parameter Calculation fails to return correct value
Operating system version
Description of the issue
When using GetNthRecord to return a value from a related table inside a calculated script parameter, it returns a value from the first related record instead of the Nth Record.
Steps to reproduce the problem
I'm using this calculation inside the script parameter box:
List ( GetNthRecord (Dates::DateField ; $$RecordNumber ) ; 1 )
The related records in Date are:
and $$RecordNumber = 2
If I put GetNthRecord ( Dates::Datefield ; $$RecordNumber ) in the data viewer, I can confirm that 8/10/2011 is returned just before I click the button that passes this parameter to my script. Using the debugger to halt the script on its first line of code, shows that it still evaluates as 8/10/2011, but Get ( ScriptParameter ) returns: 8/3/2011¶1.
Use steps within the script to find and access the Nth related record in this table.
GetValue ( List ( Dates::dateField ) ; $$RecordNumber ) is also an alternative that occurs to me while typing this report, but have yet to test that approach...