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.

Perform Find stops script

Featured Replies

I have a script that performs a find then exports the records then does other things. The problem is if there are no records to be found it stops the rest of the script and displays a dialogue box that says “No records match this set of find request” If it finds nothing then I want it to find nothing and export nothing and move on to the next step. Not stop the script. How can I over come this?

Set Error capture on right before the perform find [] step. Then can use and If statement along with get(lasterror) or Get(FoundCount) to do stuff only when there is a found set or viceversa.

  • Author

I set error capture to no. But I still get the same error. I don’t want to mess with if then statements. If I did someone could still change things so that there are no records after if then statements and it would stop the script dead again. I just want it to continue on without the message needing someone to click continue.

I am having a similar issue with XML files. When another scripts import them, some do not have data. When this happens I get an error box saying “The main XML document cannot be empty” I have checked “Perform without dialog” but I still get one, and I have to click ok for script to continue.

How can I get these scripts to happen without requiring user interaction? I don’t care if there is no data to export or no data in the XML file just go one to the next step.

Edited by Guest

Hi crowman,

John suggested setting error capture ON, not off (you said 'no', unless that was a typo). If error capture is ON and no records are found to export then your script will just continue without the dialog box popping up. But it is cleaner if you skip the export step if no records found, so script might look like this:

Set Error Capture [ On ]

Perform Find [ Restore ]

[color:red]If [ Get ( FoundCount ) ]

Export records

End If

... put the rest of your script here.

You can use If [ Get ( LastError ) ] instead of the red portion or you can even trap for a specific error. When not finding records, I prefer testing for found count instead of specific error capture but that's just a personal preference.

So setting error capture ON stops FileMaker's dialog. But be sure to handle any possible errors within your script yourself (or ignore them entirely as you wish to do in this case).

LaRetta :wink2:

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.