AnsweredAssumed Answered

Script Parameters or Loop Script

Question asked by ndveitch on Jun 28, 2016
Latest reply on Jul 2, 2016 by ndveitch

Hi There,


I need to find out which idea would be the best.


I have a situation where a client has a file on a number of iPads which is a copy of the main hosted file. The users enter in their data on the iPad's and because there is no internet where they are working. They have to come back to the office before the data can be synced back to the main system. I have tried GoZync with another client and it worked great, the issue here is, there is a chance that the data might need to be manipulated slightly before being synced back to the main program. With the file being a copy of the live system, there is a lot of data in those files that is not needed. I would first have to clean them up before doing any kind of import. Another factor that was not taken into consideration was the numbering sequence of one of the fields which is a legacy issue that is only being found out now.


Anyway, I got cracking doing the clean up script and while thinking about what is going to go into it, I believe that there are going to be multiple times where I just duplicate that portion of the find request and change the go to layout and set field name in the find. The rest of that portion of script is fairly the same,


Go to Layout [????]

Enter Find More (off)

Set Field [ ?????::JobNumber ; "ABC111" ]

Perform Find

Show Omitted Only

If [ Get ( FoundCount ) <> 0 ]

Delete All Records [Off]

End If


For many of the layouts I go to, only the "????" will be different. Would it be better to have 1 script and build 2 lists, one for Layout name and the other for field table name, and then run the script with a loop and use the 2 lists as indexes. Or would it be better to rather run 2 scripts, one with a whole whack of perform script steps, passing the layout name and field table name as script parameters to a second script. Then the second script sets variables using GetValue ( ) and those variables are used to replace the "????" accordingly?