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.

Multiple find requests within loop script

Featured Replies

I'm trying to create a loop script (eg. pauses for user interaction and then continues via a button) that will allow the user to select one or multiple checkbox values in a single field.  The field here will be "Fiscal Quarter" and will have multiple values (displayed as checkboxes) such as "Q4 15", "Q1 16" and so forth.  I'm not sure off the top of my head how to generate new find requests from the user clicking multiple checkboxes within a single field.  The goal would be to generate a new find request for each checkbox checked, and to remove the find request if the checkbox is subsequently unchecked.

I'd like to avoid separate hard-coded fields for each Fiscal Quarter, as these would need to be manually updated.

Before I go hammering away at this I thought I'd see if this was a process that someone has already figured out.

Thanks for your help.

Edited by davidnickerson

I would have the value list for the checkboxes attached to a global field. When the script is fired, you now have a list of the checked values.

Count how many with ValueCount, then loop and extract each line with GetValue creating a new Find request each time.

Pseudo-code:

Set Variable [ $fiscalQuarters; Table::FiscalQuarters_g ]
Set Variable [ $count; ValueCount [ $fiscalQuarters ]
Set Variable [ $i; 1 ]
Go To Layout [ Relevant Layout ]
Enter Find Mode
Loop
 Set Field [ Table::FiscalQuarter; GetValue [ $fiscalQuarters; $i ]
 Exit Loop If [ $i = $count ]
 Set Variable [ $i; $i + 1 ]
 New Record / Request
End Loop
Perform Find

(Written off the top of my head, not tested etc )

A field formatted as checkboxes contains a list of the checked values -  so basically you are asking how to create a request for each item in a return-separated list. See an example here: http://fmforums.com/topic/99419-find-from-a-list/#comment-452506

Note that the checkbox field needs to be a global field - otherwise you may have a conflict between two users searching for different values.

 

  • Author

Thanks, both of you.

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.