No records found script issue

Discussion created by ziceg on Mar 11, 2014
Latest reply on Mar 11, 2014 by ziceg

I have created a script to find out if there are any records with a particular Find Criteria, when there are records that match it works find and takes me to the List view etc. But if there are no matching records to the Find it keeps coming up with the FM Error pop up "No records match this find criteria - Cance - Continue - Modify Find" I have set up and error capture and followed instructions on a video form John Osborne but still it keeps showing me this pop up and not the one I set up to say "no records" and take me back to my Menu window. Not sure where else the issue could be. My script is as per below:


Set Error Capture [On]

Go to layout ["Production_List" (PRODUCTION)]

Perform Find [Restore]

If [Get (LastError) = 401]

Go to Layout ["Menu" ()]

Show Custom Dialog ["Error"; "There are no items to be shown"]


Enter Browse Mode []

Sort Records [Restore; No dialog]

Adjust Window [Resize to Fit]

End If


Any help would be appreciated.