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.

Problem using Find in a script with custom dialog

Featured Replies

Hello,

I have a button with a script that is intended to perform a Find using a value entered into a custom dialog.

This script generates an error alert rather than performing the Find.

As shown in the screen captures in the attached zip file, 1) the input field is assigned to button 1 (default; rightmost) in the custom dialog, 2) I am typing a correct value ("March") in the custom dialog, and 3) if I type "March" into the target field that is referenced in the Input Fields tab in the Custom Dialog dialog, the Find functions properly.

What have I done improperly and what is necessary to correct it so that the script will perform the Find after entering a search term in the custom dialog?

Many thanks in advance!

P.S. If the zip file contains any files/folders that have a name beginning with a period or slash, please ignore and trash them. Regrets for any inconvenience.

Screen_captures.zip

  • Author

Here is some additional information.

FM Help contains an example of using a script, custom dialog, and input fields to perform a Find. In the example, the script line Perform Find includes [Restore].

This means that the example assumes a Find Request has been specified in the Edit Script window for the Perform Find command; otherwise, the example's script line would be "Perform Find []" rather than "Perform Find [Restore]."

I therefore specified the Find Request as shown in the attached screen capture.

I have run the script after having deleted the Find Request specification. Instead of displaying an error alert, the script returns to my original layout.

How can I fix this so that it works properly?

Thanks in advance!

Specify_find_request.png

The option 'restore' in the perform find script step means that you perform an older query saved in this script. Surely not what you intend to do.

- jens

  • Author

Jens,

Thank you for replying.

If I uncheck the "Specify find requests" checkbox for the Perform Find command in the Edit Script window, then the [Restore] is removed from the Perform Find command.

I then execute the script, type "March" (without quote marks) in the custom dialog, and the script returns to my original layout without having found the 24 records for which the Month field contains March.

Do you have a different suggestion that would solve this problem?

I have built an example db which works well and finds 'march'. Cmd-1 to execute the script.

-jens

search.zip

  • Author

Hello again.

Correct, your script works properly and it led me to dissect my script, removing one line at a time until it worked properly. Then I added back the lines, tweaking until it finally worked properly.

Jens, thank you very much for your time, help, and patience!

Barry--

I'd like to take a minute to discuss your custom dialog. When you set a custom dialog to use a data field, you are going to actually change the contents of that field. So whatever record was on display at the time you executed this got changed to "March". If you create a global field gSearch and use it in this dialog, you can then use a script to:

Enter Find Mode

Set Field[Event; gSearch]

Perform Find[]

David

  • Author

David--

Thanks for your message.

Actually, following Jens' advice above, the custom dialog works perfectly. FileMaker uses the value I enter in the custom dialog as a search term rather than changing the contents of that field.

Cheers!

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.