2 Replies Latest reply on Jul 10, 2017 11:06 PM by RandyHandley

    Script help

    RandyHandley

      I have three fields that I am using to change the status of inventory items.

       

      I have 4 buttons that go along with them to save the changes to selected records.

       

      The fields are:

      Change status

      Change Storage location

      change Performer

       

      The buttons are

      Save new status

      Save new location

      Save new performer

      Save all

       

      I am trying to write a script for the save all button.

      Currently I have a table called change status which where the change status,location, and performer can be selected from.

       

      The scripts that i have written currently use set variable and set table to copy/paste which works great.

       

      What I would like to achieve with the save all script is that it will save all three fields to the selected records.  However with how I have it now when one of those fields is empty it also empties the destination record.  How do I get it to not change the destination record if the change field in empty?  I have used the ISempty function but I am not certain if there is a better method.

      Any advice would be a great help and much appreciated!

       

      Thanks!

        • 1. Re: Script help
          mikebeargie

          you need to wrap your fields in IF statements.

           

          Like so:

          If [ Not IsEmpty ( Change status ) ]

              //Go and set all of the records with Change status

          End If

          If [ Not IsEmpty ( Change storage location ) ]

             //Go and set all of the records with Change storage location

          End If

          If [ Not IsEmpty ( Change performer ) ]

             //Go and set all of the records with Change performer

          End If

          that way it only does the action if the field is not empty.

          • 2. Re: Script help
            RandyHandley

            Thank you!! works like a dream