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

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

Recommended Posts

Posted

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!

Posted

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

Posted

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

Posted

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.

This topic is 5735 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.