Jump 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.
Juggernaut

Empty searches stopping scsripts

Featured Replies

Hi there,

I have a few scripts in which I'd like to search for the presence of certain records in certain tables. If no records are found, I'd like one thing to happen, if records are found, I'd like something else to happen, all behind the scenes and invisible to the end user. There are a few different scenarios on our DB where this would be helpful.

The issue I run into is that when no records are found, the script is stopped and a message is displayed saying no records were found that match the search criteria, with the button choices of what to do next. Is there any way to suppress this dialogue, or any other way to deal with empty search results? I've tried using logic like when Get(FoundCount) = 0, but to get the found count it still needs to perform the search first, which displays the dialogue.

An example of this: on a certain layout users can click checkboxes for multiple records that, when checked and a "process" button is clicked, will initiate a certain action on those records. However, before I present the users with the list of records, I'd like to do a quick search to make sure no records are checked already (and if they are to un-check them), something I could see happening if a previous user closed the application or somehow left the layout during the above workflow.

Any thoughts / ideas much appreciated!

You can suppress the dialog by adding Set Error Capture On at the beginning of the Find script.

  • Author

Excellent, and so simple I'm a little embarassed - thanks, will give this a shot!

  • Author

Worked perfectly. Thanks!

Be careful. Now that you've turned Error Capture On, be sure to trap and handle any errors.

I've tried using logic like when Get(FoundCount) = 0, but to get the found count it still needs to perform the search first, which displays the dialogue.

And this is what Barbara means about trapping for errors. Now that you realize you can use Set Error Capture [ On ], you need to figure out what to do after your find. So it would look something like this:

Set Error Capture [ On ]

Perform Find [ stored find request ]

If [ not Get ( FoundCount ) ]

... no records found.

Show All Records

Go To Layout [ original layout ]

Exit Script

End If

... records found - do whatever you wish.

Create an account or sign in to comment

Important Information

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

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.