Product and version
FileMaker Pro 15.0.2
OS and version
The “save as pdf” script instruction does not set the error code to 0 when it is performed correctly.
Therefore, the error code remains the one of the preceding instruction.
That means, the function get(LastError) just after the “save as pdf” script instruction actually returns the error of the preceding instruction.
In our example, the preceding instruction is the loop exit (error 101 – missing record)
How to replicate
Attached example file
Workaround (if any)
The workaround is to insert an instruction that reset the error as f.i. “Commit Record/Request”