3 Replies Latest reply on May 13, 2015 3:15 PM by philmodjunk

    script trigger when any field value changes

    HB

      Title

      script trigger when any field value changes

      Post

      While using a certain layout, I would like a script to run when any field's value that is on that layout (30+ fields) is changed by the user.

       

      Currently, I am using the layouts' OnRecordCommit Script trigger, and that runs the script when changes are made, but also anytime a field loses focus - which is too often. Is there a better way? Thanks so much.

        • 1. Re: script trigger when any field value changes
          philmodjunk

          OnObjectSave comes to mind, but you'd have to set this up on every single field.

          What you describe for OnRecordCommit isn't quite correct. If you have opened the record for editing by clicking into a field and then click the layout background, a Commit event takes place and trips the trigger. but if you change focus from one field to another via mouse click or pressing a key such as Tab that moves the cursor to the next field in the tab order, no commit event takes place. You can cover the background of your layout body with an empty, invisible web viewer and then mouse clicks on the layout background will not commit records as the mouse click is then intercepted by the  web viewer object.

          • 2. Re: script trigger when any field value changes
            HB

            Thanks - you are correct..I habitually click the background and that would activate the script - a nice feature for future versions would be  whenever a record is saved a script triggered.

            • 3. Re: script trigger when any field value changes
              philmodjunk

              That's exactly what OnRecordCommit is. It's just that clicking the layout background is one way to save your changes to the data.