onPreProcessStatusChange event (Client API reference)

Applies to Dynamics 365 (online), version 9.x

This event occurs before the status of a process instance changes.

Use the formContext.data.process.addOnPreProcessStatusChange method to add event handlers for this event and the formContext.data.process.removeOnPreProcessStatusChange method to remove them.

From within a web resource script registered to the onPreProcessStatusChange event, a developer can invoke the following on the executionContext object passed into the web resource script:

executionContext.getEventArgs().preventDefault();

When you invoke preventDefault:

  • The state change will not be processed. The process instance will remain on the original stage in the original state.
  • The save of the main form will not be processed. If the main form was in a dirty state, it would remain in a dirty state.
  • Any web resources that registered onProcessStatusChange will not be invoked.

This client API is only supported on the unified client. The legacy web client does not support this client API.

Methods supported for this event