3 Replies Latest reply on Jun 9, 2014 7:51 AM by Mingrl88

    Setting GetLastMessage Value Using a Script Step

    Mingrl88

      Title

      Setting GetLastMessage Value Using a Script Step

      Post

           In my solution any time someone makes a change on certain layouts a custom dialog pops up that says "Do you want to save these changes?" This works really well most of the time but currently I am trying to run a script that loops through all the records and sets one field equal to a concatination of several other fields. The script to set the field works but for each record it triggers this custom dialog. 

           Does anyone know a way to set the "(LastMessageChoice)" in a script step or maybe just keep the pop-up from happening at all? Like a way to suppress that script maybe? I tried "set error capture" but that didn't work. Any ideas would be really helpful. 

           THANKS!

        • 1. Re: Setting GetLastMessage Value Using a Script Step
          mleering
          What event is triggering the script? One thing I would want to try is using replace field contents (assuming that you only loop through found records). It might get around most of your triggers.
          • 2. Re: Setting GetLastMessage Value Using a Script Step
            philmodjunk

                 Replace field contents is definitely a simpler solution than looping through records, but you may find that you still trip a script trigger at least once that you may not want to trip.

                 To avoid tripping a script trigger, you can use a global variable as a "switch" to disable the trigger driven scripts.

                 Your script where you don't want to trip such triggers would have this code:

                 Set Variable [$$TriggersOff ; value: True ]

                 Rest of script goes here

                 Set Variable [$$TriggersOff ; False ] --> also put this step just before any exit or halt script steps.

                 Your trigger performed scripts would then be set up like this:

                 If [ Not $$TriggersOff ]
                  

                 rest of script goes here

                 End Ifk

            • 3. Re: Setting GetLastMessage Value Using a Script Step
              Mingrl88

                   Matt and Phil,

                    

                   Thanks for getting back to me. I actually did come up with the "global variable" solution and it works like a charm! I'll have to play with "replace field contents" but I think Phil is right, since the script triggers on the "on record commit" trigger I think that would still be a problem - but may be useful for other things!

                    

                   Thanks again - I appreciate the prompt and insightful replies!