It always helps to post your script when you are having problems which result from the way you have written your script.
The only reason why this script command would, in and of itself, cause a script to stop is if after it exits the loop there is no further work for the script to do. Try adding an additional step immediately after the loop—eg. Set Field ()—so that the script has something to do after exiting the loop; using the debugger you will be able to see that the script is simply moving to its next command, not crashing.
That said, the problem will have something to do with how your script is written—the order of steps, the exit condition, etc. If, as suggested by Bruce, you post the script itself (print it to a pdf, then copy and paste into your post) someone will spot the problem and assist you.
Ooops I made a mistake in my post, its very simple, it's the GoToRecord/Request/Page [Next; Exit after last] script step. Setup one record in the found set and run this script. The file may need to be revovered as an option.
GoToRecord/Request/Page [Next; Exit after last]
Show Custom Dialog ["Test"; "Test Success"]
That's it, it never shows the Custom Dialog.
When not used in a Loop/End Loop and at the last record of a found set, the Exit after last option works as the script step Exit. Certainly confusing, but documented behavior:
"Exit after last tells FileMaker Pro to stop the script when it reaches the last record in the found set. You can use Exit after last with the Loop script step to exit out of a loop after the last record."
So no loop? If the Exit after last option was inside a loop it would exit the loop and continue with any commands the script contains beyond the loop. If used OUTSIDE of a loop then, logically, it exits the script. What else would it do? If you put your custom dialog step before the exit step it would perform that step OK.
Yes, we ran into this problem when using this script step within a loop script and it did indeed exit the script completely, even when there were more script steps after the loop script. We created a new window off the screen -500/-500 and then the last script steps after the loop were to recenter the new dialog in the main view. But because after the GoToRecord/Request/Page [Next; Exit after last] in the loop script quit and kept the dialog off the main view, having to scroll down to the dialog. We stepped through the script and it simply quits cold when inside the loop script.
If GoToRecord/Request/Page [Next; Exit after last] is at the start of the loop it would have the effect you mention. If you put it as last step in the loop it will have already completed the other commands inside the loop before exiting.
No its in the inside of the loop and near the end of the loop script and it only happens when there is one record in the found set. If there are more than one record in the found set, it works fine.
I think if you want to pursue this further you had better post the file, or at very least the script. I've gone about as far as I can flying blind.
If there is only one record in the found set, the script is on the record
before the go to next record script step. So when it executes it exits...
Because it was on the last record.
Sent from my mobile device...
Please excuse typos.