Hi All - I am on 188.8.131.52 and have escalation that executes an action launchpoint automation script that updates a workorder. I have coded the setValue to noaction(see below). I do not have a save() on mboset but records are saved and updated without that and all is working good - except other workorder automation scripts that have save launchpoints are also executing and I don't want that. I thought the noaction would prevent other scripts from executing ? Any insight one what I am doing wrong?
mbo.setValue("FTW_ACTUALDUR", diff, MboConstants.NOACTION)
I have also tried adding a save to mboset in the auto script - I have tried ways listed below but other autoscripts still fire when escalation runs.
Thanks for any ideas!
In the automation script which you want to run only from UI and not from Escalation, use interactive check.
//your logic which should run from UI and not from escalation.
Thanks Prashant - good idea that I had not thought of.
It sounds like your have a design issue with your scripts in general.
There are two things to consider, for a given Object / Attribute etc you should only have a single script that owns the launch point. If you want to break your script up into multiple scripts, do so and then call those scripts from the one that owns the launch point. This way you have control over which scripts fire and what order the execute in.
Here is an article that explains this approach: https://www.sharptree.io/blog/2021/2021-11-29-js-invoke-library/
The other thing I recommend is using a main function as the entry point for your script. Something like:
# your code here
// your code here.
This lets you have an entry point within the script from which you can exit. So anywhere in the process you can call return and stop execution without worrying about falling through and executing something unexpected.
Hope that is helpful.
Join CommunityInvite ColleaguesLearn MoreGet Started on MORE