How to get the right execution context during runtime

605 Views Asked by At

I'm trying to prevent a userevent script from running in case of a mass update triggering it. Pretty simple task you might think. Usually the runtime.executionContext should give me the value that I'm looking for. What I'm expecting is runtime.ContextType.CUSTOM_MASSUPDATE but I keep getting the runtime.ContextType.USEREVENT.

What I need is the value that is correctly written in the system notes for this action:see here

Can anyone tell me where I can get this context value during runtime?

1

There are 1 best solutions below

1
Simon Delicata On

Instead of trying to code around the context, why not change the deployment to prevent execution under Custom Mass Update ?

Locate the Deployment, move to the Context Filtering tab and scroll through the Execution Context field looking for the Custom Mass Update option and deselect it.

Deployment Example