1 Reply Latest reply on May 7, 2014 1:56 PM by philmodjunk

    Script to validate multiple fields

    Badam

      Title

      Script to validate multiple fields

      Post

           I am writing a script that validates a number that is entered between 0 and 255 and show a message if it is not within that range. I want to use this script for many different fields via a script trigger.

           I know that I could define the field with validation and display a message but the “Revert Field “ button on that message means nothing to my users, so I want to make the message less confusing and more user friendly.

           Is there a script step that captures the value from whichever field this script was triggered from? (I am thinking the best approach is using a script trigger to run this “validate” script)

           Thanks!

        • 1. Re: Script to validate multiple fields
          philmodjunk

               You should be able to have your script check the value of Get ( activeFieldContents ) as a way to check the value of the field without specifying the field explicitly.

               You can also use GetFieldName ( YourTable::YourField ) in a script parameter to the script as a way to pass the name of the field. Then GetField and Set Field By Name can be used with Get ( ScriptParameter ) to indirectly access the data in the field.