November 21, 20169 yr 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 November 21, 20169 yr by davidnickerson
November 21, 20169 yr 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 )
November 21, 20169 yr 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.
Create an account or sign in to comment