Tip #94: Cancel workflow in style

If you decided to follow our previous tip and cancel workflows only when necessary, you may wonder what does the Set Properties button for this step do. As it turns out, stopping workflow has a single property called Status message:

Cancel workflow properties

The best use of this property comes with the new real-time workflows in CRM 2013. If the workflow is part of transaction initiated by a user e.g. when creating a record, and Status message property is not set then the user will see a generic error message:

Business Process Error
ISV code aborted the operation.

If Status message property is set then it will be displayed instead of “ISV code aborted the operation.”. The best part is that status message can be built at run-time to contain references to the attributes of the workflow records:

Sample message for canceled workflow

One thought on “Tip #94: Cancel workflow in style

  1. Tripti says:

    Very useful post. Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *