When running a script to loop through records and you have the Exit after last checked, you get a 101 error message, record is missing. I “understand” this is supposedly expected behavior, however to me it’s an erroneous error since you have the box checked to exit after last. It’s kind of like “duh, I know the next record is missing, that’s why I’m exiting this loop.”
This is a problem when running the script server-side. The schedule indicates an error and the log viewer shows “FileMaker Script Error.” The script actually performed OK and was successful, but reported the 101 error and shows the error status.
I tried trapping for error 101 and then just exiting the script, but the error was still reported to the FMS log and displayed in the Schedule Window as “FileMaker Script Error.”
The only way around the error is to put a condition to check if you are on the last record, something like:
Exit Loop If [Get ( FoundCount ) = Get ( RecordNumber )]
Put this exit loop condition right before the Go To Next Record script step.