Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

when find yields no results

Featured Replies

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!

Either

code:


Status ( CurrentFoundCount ) = 0


or

code:


Status ( CurrentError ) = 401


I think you also need to capture the error code with:

SetErrorCapture(On)

Immediately after the find you also need a:

Status(CurrentError)

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 ]

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.