Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Status(Current Error) not suppressing dialog

Status
Not open for further replies.

RikForgo

Programmer
Jul 31, 2002
59
US
I've set up a script routine where the values are dynamic based on user input (via set field in an unsaved Find Mode). For some reason, the FileMaker "No records match this request." error message is not being suppressed by the If Status(Current Error) statement.

The script works, but "My Message" only appears AFTER the default FileMaker error message. What am I doing wrong here?

Here's the script ...


Toggle Window [Minimize]
Go to Layout ["Reg"]
Enter Find Mode[]
Set Field [&quot;STATUS&quot;, &quot;<3&quot;&quot;]
Set Field [&quot;CARR&quot;, &quot;g_carrier_route&quot;]
Perform Find[]
If [&quot;Status(CurrentError)= 401&quot;]
Show Message [&quot;My Message&quot;]
Go To Layout [Renewal 1]
Toggle Window [Maximize]
Halt Script
Else
Sort [Restore, No Dialog]
Toggle Window [Maximize]
End If
 
Insert the Set error capture as second line in your script.
Use this on early in the script and insert a little code dealing with the errors. You can find the errorlist codes in the helpfile.

By default FM presents alert boxes when an error that it is designed to handle is detected. (This is the equivalent of SetErrorCapture (Off).
By adding this step and setting its option to On, you tell FM to suppress all error messages while the script is running, usually because you intend to do the error trapping yourself by using the Status(CurrentError) function.

If you turn on SetErrorCapture, you absolutely must handle the errors. Otherwise the script will fail without any warning at all, because you have captured and eliminated from display FM's built-in, generic error message.

HTH

John
 
Duh. It's been a while since I've worked in FMP. I can't believe I forgot this step. Thanks for the help, John.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top