2 Replies Latest reply on Apr 2, 2014 5:07 PM by Stephen Huston

    How to run a script across all records?

    hafiz5198

      I created a layout that display records in list view. I inserted a button in that layout and set it to run my script. But the problem is that the script only runs at the active record. How to make the script runs through all the records in that table at the same time?

        • 1. Re: How to run a script across all records?
          erolst

          hafiz5198 wrote:

          How to make the script runs through all the records in that table at the same time?

          More like one after the other …

           

          Anyway: you can either use a loop to traverse your found set (or all records), or use a script step that processes all records in the current found set (e.g. Replace Field Contents).

           

          The optimal approach depends on what your script does.

          1 of 1 people found this helpful
          • 2. Re: How to run a script across all records?
            Stephen Huston

            The looping script approach is better for trapping for errors in case a record is in use by another user in a hosted environment.

             

            It is also simpler to have a looping script test for certain conditions/data in each record and make changes only where they are needed, depending on the data/conditions you want to test for or change.

            1 of 1 people found this helpful