Wednesday, August 30, 2017

Activate/Deactivate Entity in Dynamics CRM without Plugin or Javascript

Hello readers!

Recently i came across an issue where i need to activate/deactivate the record based on some conditions.

I did bit of search on web to see if there is any simple way except writing JavaScript or Plugin and came up with nothing.

I tried doing by Business rule to change the status to "Inactive" however that doesn't actually deactivate the record, it just change the status of the record to "Inactive".

Then i tried creating a Workflow, first to run as a background process, which we usually do, and that kind of resolve the issue, but not as needed.

I came as a following solution after all of this:

  • Add a new Process as a Workflow
  • Make sure to add that as an on demand rather then run in background, i will explain the reason later in this post.
  • Make this to run on change of specific field/as needed for your business requirement.
  • Then add your condition to check before you activate/deactivate the record
  • then add update record step where you change the "Status" field to "Inactive".
  • Make sure to save and activate the workflow
Now, the reason i ask to create this as on demand rather then run in background is because, if you select to run in background, it is possible that while the workflow is running in background, someone can change the field on the record before it actually gets deactivated.

Questions/comments/suggestions? please put it in comments below post for further discussion!!!

Follow By Email for more updates directly into your inbox...


No comments:

Post a Comment