5 Replies Latest reply on Jan 17, 2011 1:23 PM by ultranix

    Script triggers.

    ultranix

      Title

      Script triggers.

      Post

      My data into the field, which uses the script triggers could be entered:

      1) by a script [set field]

      2) manually.

      I tried OnObjectModify, but it is blinking whenever I type a character in that field.

      As I need that info [it is a part of calculation] entered in that field, so I need a way to set script triggers, so the script is loaded after either that field value is entered by another script or manually.

      How do I do that?

        • 1. Re: Script triggers.
          philmodjunk

          OnObjectModify will fire each time you press a key while the cursor is in the field. Try onObjectSave or OnObjectExit for results that will kick in when you exit the field rather than each time you press a key.

          • 2. Re: Script triggers.
            ultranix

            I tried onObjectSave, if i'm not mistaken.

            But here's another problem: it just doesn't load the script, if that field is set through another script [i.e. not manually]

            • 3. Re: Script triggers.
              philmodjunk

              Script triggers only respond to specific events. For Field based script triggers such as these, if another script modifies the field, that script should then call the trigger script as it won't trigger the script trigger you've set on the field. Neither will drag and drop editing, which can be a much more serious limitation here.

              • 4. Re: Script triggers.
                FentonJones

                Script Triggers attached to a field (on a layout) do not fire when you Set Field via a script. This is good (in my opinion), as it would be difficult to handle all these things firing.

                This is not really a problem, as you are ALREADY IN a script. So, if you want it, just add whatever the script trigger script is doing; or possibly just call the triggered script yourself.

                Some script steps, such Insert Calculated Result will cause the trigger to fire. But that will not work (at all) unless the field is on the current layout when that happens.

                • 5. Re: Script triggers.
                  ultranix

                  Thanks for your answers Phil and Felton. Sometimes what's so obvious, never comes out first :)