AnsweredAssumed Answered

GetNthRecord and List function

Question asked by karo on Jul 30, 2012
Latest reply on Jul 30, 2012 by philmodjunk

Summary

GetNthRecord and List function

Product

FileMaker Pro

Version

11, 12

Operating system version

Mac OS 10.8

Description of the issue

Within the list function the getnthrecord is calculated wrong, althoug it will allocate in a let-function. Using a $-variable instead of the local let-function it works correct.

Steps to reproduce the problem

For example (field1 is a serial number):
Let ( [
          var.current = demo::field1;
          var.preview = GetNthRecord ( demo::field1 ; Get ( RecordNumber )+1 );
     ];

    // this is correct
     "A: " & var.current & ¶ & var.preview &
     "¶------------¶" &

    // this is INCORRECT, here with local let-variable
     "B: " &
     List( var.current; var.preview ) &
     "¶------------¶" &

    // this is correct, here with local $-variable
     "C: " &
     List( var.current; $var.preview )
)

Expected result

Section "B" should look like A or C:
"A: 2
3
------------
B: 2
3
------------
C: 2
3"

Actual result

Section "B" is wrong, because it is not showing the next record value ("2" instead of "3")
"A: 2
3
------------
B: 2
2
------------
C: 2
3"

Configuration information

I have uploaded a demo-file at:
http://transfer.karo.at/dev/demo_getnthrecord_v1.fp7.zip

Workaround

Use local $ variable instead of local let variable:

This does not work in list:
var.preview = GetNthRecord ( demo::field1 ; Get ( RecordNumber )+1 );

This works within list function:
$var.preview = GetNthRecord ( demo::field1 ; Get ( RecordNumber )+1 );
This also works (see end of line)
var.preview = GetNthRecord ( demo::field1 ; Get ( RecordNumber )+1 ) & "";

Outcomes