this is not community feedback but a Discussion question. You may move this to a space where more users will see it or @TSGal or @TSPigeon can help you move it.
Thank you for your post!
As beverly mentioned this post may be better suited for Discussions or Report a Product Issue as this does not relate to an issue or question about the FileMaker Community itself. I will move it do Discussions so you might receive further views and advice.
I was unable to reproduce this issue with FileMaker Pro 15 (Advanced) on Mac OS X or the Windows Operating System. To attempt to reproduce I followed these steps:
1. Created test.fmp12
2. Created "Script"
Set Error Capture [On]
GoToRecord/Request/Page [With Dialog: Off ; "2"]
If [Get(LastError) = "0"]
Show Custom Dialog [ "Last Error was 0" ]
Show Customer Dialog [ "Last Error was" & Get(LastError) ]
3. Ran Script with less than 2 records and received the Dialog "Last Error was 101"
4. Ran Script with 2 records and received the dialog "Last Error was 0"
The script seems to work as expected in my sample. Let me know if you have further steps necessary to reproduce.
Are you able to replicate this in a new file?
It looks like the key information needed to diagnose this is not shown. What script steps precede Get ( LastError ) in your script?
In general terms, Get ( LastError ) has to be used immediately after the script step that produced the error. We often set a variable to that value when we need to do something with that error code at least one more script step later in the script and thus it is retained in the variable.
I know it will sound obvious, but make 100% sure that there is no script steps between the step that gives the error code and the if statement.
Hope this helps
If($le) = 0
show custom dialogue1
I know this is pseudo-code, but to make sure, the clause, in pseudo-code, should be
($le = 0) and (Get(LastError) = 0)
Also, for convenience, please see my function for quick interpretation of the error code you get: