Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sets a Process as the active process.
If the business process being set as active already has an instance, the instance will be marked as active and the primary record form will be reloaded to show it. If no instance exists for the process, a new instance is created, marked as active, and the primary record form will be reloaded to show it.
If multiple instances of the process exist, one of these will be chosen as per the defaulting logic to be marked as active. Typically, this is the most recently used process instance by the current user.
Note
- The
setActiveProcessmethod should be used while creating or editing a record. Use thesetActiveProcessmethod to set the active process for a business process flow instead ofprocessIdandprocessInstanceIdwithXrm.Navigation.openFormmethod . - The
setActiveProcessmethod will reload the form and any unsaved data will be lost.
Syntax
formContext.data.process.setActiveProcess(processId, callbackFunction);
Parameter
| Name | Type | Required | Description |
|---|---|---|---|
processId |
String | Yes | The Id of the process to set as the active process. |
callbackFunction |
Function | No | A function to call when the operation is complete. This callback function is passed one of the following string values to indicate whether the operation succeeded: - success: The operation succeeded.- invalid: The processId isn't valid or the process isn't enabled. |
Related articles
getActiveProcess
setActiveProcessInstance
formContext.data.process