Jump to content
Sign in to follow this  

Multiple find requests within loop script

Recommended Posts

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

Share this post

Link to post
Share on other sites

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.


Set Variable [ $fiscalQuarters; Table::FiscalQuarters_g ]
Set Variable [ $count; ValueCount [ $fiscalQuarters ]
Set Variable [ $i; 1 ]
Go To Layout [ Relevant Layout ]
Enter Find Mode
 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 )

  • Like 1

Share this post

Link to post
Share on other sites

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.


  • Like 1

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Who Viewed the Topic

    1 member has viewed this topic:
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.