Workflows in Dynamics CRM can do a lot, but a significant limitation is that they're asynchronous. If you need to automate server-side code execution and interact with the user at the same time, you're out of luck. This is where you can use something that I call a macros system.This is the first of a three-post series in which I will:
- outline a business problem that a macros system can solve
- give an overview of the structure of our CRM macros system
- share some sample code for how to implement a basic set of macros for a CRM business entity.
My company manages insurance policies in CRM. An account (in our system, what we call "account" is a custom entity, but that's not important right now) has one or more policies. A simplified representation of a policy would have the following attributes:
- policy number
- premium $
- commission $
- effective date
- renewal date
- status reason - active/terminated/expired/etc.
- status date
- Select the correct policy status reason.
- Save and close the policy record.
- Wait for a workflow to execute to:
- clone the original policy record with a plugin and advance the dates accordingly
- update the original policy record
- Manually refresh the list of policies associated with an account to see the new one.
- Open the new policy record and update the premium and commission values.
- updates the original policy using the CRM Web services
- creates the new policy using the CRM Web services
- closes the original policy form
- opens the new policy form for the user to complete the missing fields
- Only one click was required to get the agent to the point to complete the new policy record.
- The agent doesn't have to go looking for the new policy record.
- Updating the process, which happens more often than I'd like, can be done during business hours by pushing out an updated macros website instead of unpublishing/modifying/republishing a workflow.