setActiveProcess (Client API reference)
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.
setActiveProcessmethod should be used while creating or editing a record. Use the
setActiveProcessmethod to set the active process for a business process flow instead of
setActiveProcessmethod will reload the form and any unsaved data will be lost.
|The Id of the process to set as the active process.
|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.