Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4679 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

FM 11 Advanced

I always thought that to suppress an error message when no records were found that you needed to have an if statement immediately after the find to capture the error code. I use the following script steps to allow the user to do repeated finds until one of them is successful. It does not even use an If statement, and the error message does not appear if a find fails. It does however use an Exit Loop If statement.

Allow User Abort [ Off ]

Set Error Capture [ On ]

Go to Layout [ “Find customer” (Customer) ]

Loop

Enter Find Mode [ ] [ Pause ]

Perform Find [ ]

Set Variable [ $E; Value:Get ( LastError ) ]

Exit Loop If [ $E ≠ 401 ]

Show Custom Dialog [ Title: "no record"; Message: "The record does not exist. Press OK and try again."; Buttons: “OK” ]

End Loop

So, what is the correct technique to suppress the No Records Found Error message?

Posted

I always thought that to suppress an error message when no records were found that you needed to have an if statement immediately after the find to capture the error code.

No, the error messages are suppressed by Set Error Capture [ On ]. Your script would work the same as:

Allow User Abort [ Off ]

Go to Layout [ “Find customer” (Customer) ]

Set Error Capture [ On ]

Loop

Enter Find Mode [ Pause ]

Perform Find [ ]

Exit Loop If [ Get ( LastError ) ≠ 401 ]

Show Custom Dialog [ Title: "no record"; Message: "The record does not exist. Press OK and try again."; Buttons: “OK” ]

End Loop

This topic is 4679 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.