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.

Finding based on user input, not pre-defined find

Featured Replies

I need to perform a find that will find a record that meets two criteria. One of the criteria is static, for all cases of the find to be performed. The other criteria is for a certain ID number. I have a layout were the user types the desired ID number in a field (I have set it up as a global field). When they click a button, it runs a script that should do a few things among which it should perform a find for records with the ID number they request. How do you do this type of find? The only finds in scripts I know how to do are pre-defined find criteria.

Also, is there a function I can call to see how many records are in the found set....to make sure the found set contains one and only one record?

Thank you!

I use a similar type of find for some of my reports. In mine I usually jump right into find mode without using a global for the ID. This is how it works:

Go to Layout [ Find ]

Enter Find Mode [ Restore ] //Restore predefined criteria

Go to Field [ "ID" ]

Pause/Resume Script [] //Wait for user input

Set Error Capture [On] //supress no records found dialog

Perform Find []

If [ Status(CurrentFoundCount) = 0 ]

Show Message [ "No records found." ]

Go to Layout [ original layout ]

Halt Script

End If

If [ Status(CurrentFoundCount) = 1 ]

Go to Layout [ Form View ]

Else

Go to Layout [ List View ]

...

End If

If you want to require user input in a field, you might use a loop or recursion (or both):

Go to Layout [ Find ]

Enter Find Mode [ Restore ]

Loop

Go to Field [ "ID" ]

Pause/Resume Script [] //Wait for user input

Exit Loop If [ "ID" ]

End Loop

Set Error Capture [ On ]

Perform Find []

If [ Status(CurrentFoundCount) = 0 ]

Perform Script [ Subscripts, "Find Script" ] //Run the find again

Exit Script

End If

...

If you want, you can use globals to gather user input. But you can't enter globals while in Find Mode. You could gather the info in Browse Mode, then Enter Find Mode and use Set Field to set the corresponding find criteria.

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.