Do you have FMPAdvanced, and if so, have you run Script Debugger? What error code occurs prior to the halt script? If you don't have Advanced, place a custom dialog step in your script before the halt and report the last error. Are you looping through the original set of records a second time? If so, you might need to either show all, or reset back to the first record so you can find what you're looking for.
There's nothing immediately obvious in the script fragment you posted. The first thing that leaps to mind is that your script is on the wrong layout when it executes the Find.
Other than that, we'd probably need to know more in detail what you mean by "not working".
You are right, I didn´t explain why it is not working.
My problem is that when running the script and there are no records found, the "No Matching records..." dialogue pops up and the script does not halt as I intend.
I need to override the "not matching records found" dialogue if there are no records found in the search, go to the assigned layout (Suppliers) and the halt the script.
Otherwise, if there are records found in the search, the script runs perfectly.
Hi Manuel: Place the Set Error Capture [On] step before the find step.
Thanks a lot Nick.
Now my script runs as intended!
Glad to help.