Allegheny Posted December 17, 2001 Posted December 17, 2001 Is there a way to script a message other than "No records match this request" that will allow me to give the options "Create new record" and "modify find"? My inclination is to create a step in the find script that says something to the effect, "if no records match the request, create new record" But how do I capture the "no records match" status? Thanks in advance!
Kurt Knippel Posted December 17, 2001 Posted December 17, 2001 Either code: Status ( CurrentFoundCount ) = 0 or code: Status ( CurrentError ) = 401
SteveB Posted December 17, 2001 Posted December 17, 2001 I think you also need to capture the error code with: SetErrorCapture(On) Immediately after the find you also need a: Status(CurrentError)
Vaughan Posted December 17, 2001 Posted December 17, 2001 The Set Error capture [on] step doesn't actually "capture" the error, it suppresses FMP from stopping or interrupting the script and generating any error message. I'd interpret the term "capture" as holding the error value in global field (using the Set Field [] step) so it can be retreived some time later. If the IF[status(CurrentError)] step is *immediately* after the Perform Find step you don't need to capture the error code into a global field. Some more explanation: The Status(CurrentError) value is set (or reset) after every script step performs. Consider this sample script... code: Set Error Capture [on] Perform Find [] Go to Layout [layoutname] If [status(CurrentError) <> 0] Beep Shoe Message [an error occurred] End If ... the way FMP works, any error code generated by the Perform Find has been repaced by the Go to Layout step, so the If [status(CurrentError)] conditional won't work as expected. The solution to the problem is to either perform the If [status(CurrentError)] step immediately after the Perform Find, or capture the error code generated by the Perform Find step. The later script would look like this: code: Set Error Capture [on] Perform Find [] Set Field [gError, Status(CurrentError)] Go to Layout [layoutname] If [gError <> 0] Beep Shoe Message [an error occurred] End If [ December 17, 2001: Message edited by: Vaughan ]
Recommended Posts
This topic is 8376 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 accountSign in
Already have an account? Sign in here.
Sign In Now