AnsweredAssumed Answered

SetField and Loop

Question asked by layotte on Dec 9, 2013
Latest reply on Dec 9, 2013 by philmodjunk


SetField and Loop


     Currently I have a script which gets an expectation id from a table, sets a global field and brings the information back to an activity table.  The users have been using the file this way but have asked to be able to select more than 1 expectation and bring them back to the activity table.  In the expectation table there are checkboxes with each expectation.  As soon as the checkbox is marked a script trigger runs the script below. I am not sure how to proceed to allow users to select more than one expectation.  I would have to take away the script trigger and add a back button but not sure if I need to do a find for all the "X" or set a number of global fields to include all the "X".  Any help is appreciated.

     Here is the script

     If [EXPECTATIONS::select_expectation = "X"]
          SetField [EXPECTATIONS::g_ExpectationID; EXPECTATIONS::__kp_expectations_id]
          SetField [EXPECTATIONS::_g_ExpectationID; ""]
     Replace Field Contents [No dialog; EXPECTATIONS::select_expectation; ""]
     Go to Layout ["ACTIVITIES" (ACTIVITIES)]
     Go to Object [Object Name: "Tab Expectations"]
     Go to Field [EXPECTATIONS::__kp_expectations_id]
     Go to Portal Row [Last]
     SetField [Activity_Expectation::_kf_ExpectationID; EXPECTATIONS::_g_ExpectationID]
     SetField [ACTIVITIES::Add_Expectation_fromActivities; "Choose Subject"]