Recently I was working in FM 17 and ran into an unexpected bug. My use case was more complex than this, but the following bare bones demo illustrates the problem.
Demo file: List+GetNthRecordBug.zip
Given two tables joined via a standard primary-key-to-foreign-key equijoin relationship…
This works as expected.
You might think you could get rid of the “& ¶ &” and use List() instead, however, try doing so prior to FM 18 and here’s what you get.
I tested in 15/16/17 and all were as above… but good news, it’s fixed in 18.
Interestingly, attempting to work around the problem by declaring standard function variables (a.k.a. “Let variables”) and then pointing List at the variables doesn’t help… pre-18 that is — the following would work fine in 18.
Finally, I discussed this with several colleagues, and Geoff Gerhard pointed out that you can work around the bug by using $vars instead of vars…
…just remember to clear the $vars out when you’re done as per the second Let statement in the above example.