1 Reply Latest reply on Jan 31, 2014 6:54 AM by philmodjunk

    Script trigger to make sure user  enters data

    EP

      Title

      Script trigger to make sure user  enters data

      Post

           I have a field on a layout.  I want to set a script trigger that evaluates if data is in a field and if so, will not allow a user to clear the field.  Rather, a user can change the value or leave the current value.  If the field was blank to begin with, nothing will trigger.  If the field is blank and a user enters data and clears it, nothing should trigger.  For the last example I think I may have to use a popup layout where records can't commit until  the window is closed and a script runs (using the web viewer trick (web viewer blocks a user from clicking outside a field to commit the record)). 

           Is this possible?

           Thanks 

        • 1. Re: Script trigger to make sure user  enters data
          philmodjunk

               If you select OnObjectEnter to pass the current value of the field to the trigger's script as a script parameter, you can use that trigger performed script to set a global variable to the value that the field had when the user first entered the field. OnObjectSave or OnObjectValidate can then compare teh value in the global variable to the current value of the field in order to produce the results that you want.