Microsoft Dynamics CRM 2011 Workflow Based Approval Process implementation – Part 3
This post is the last in a series of three posts which describe a common implementation problem of a business approval process, possible solutions and actual solution implementation.
Although in my example I used an approval process of a Quote discount %, this model can be used to implement any linear business approval process.
While the first post presented the problem and requirements, the second post describes a specific possible solution. In this post I will explain the solution implementation and it’s characteristics.
In the first post I described the problem’s main characteristics:
- Each of the involved employees should be able to find out the stage in which the Approval process is at
- Involved employees should be notified on tasks which require their attention, even if they do not login to the application
- The process should behave intelligently if some stage has exceeded a certain amount of time. For example, If the CFO has not responded in 3 days, a proper notification should ne sent to the Sales Person
- Approval process is asynchronous in nature and should ‘wait’ for the next user input without consuming expensive system resources
- The process should be flexible, so it can be easily adjusted to an ever changing business requirements. For example, adding another approving role or an additional Quote related condition
- The process should be applicable for Online and On-Premise deployments
In the following step-by-step user scenario walkthrough, I’ll explain how each problem is solved.
- Team vs. User: In some organizations, an approval task can be assigned to specific user, while in other a team of users handle the approval task. Assigning an Approval record to a team, rather than to a specific user, is useful when some employee is unable to document the decision (e.g home sick). In that case, any Team member can take and document the decision.
In Microsoft Dynamics CRM 2011, Team can be assigned with Security Roles and can own records. These features allows you to assign the Approval record to to a Team. When an Approval record is assigned to a Team, the plugin component (E4D.CRM.Plugins.Approval) will handle sending email notification to each Team member.
Since Team may have only one member, I find it more flexible and prefer assigning an Approval record to a Team rather than to a specific user. If you still want to assign an approval task to a user, change the Workflow rule described here.
- The implemented solution is based on the Workflow engine. I chose to let users activate the Quote approval process manually, but you may want to activate the process automatically when the Discount % value changes, using the proper Workflow trigger.
- The Workflow process structure has been divided into four rules to allow re-use and encapsulation. Still, adding or updating business parameters, such as Discount % levels and approving users/teams, are managed in the main Workflow rule (Quote Approval Process: Main ).
User Scenario Walkthrough
- Activating Quote approval process
Sales Person adds a Discount % value to an existing Quote, saves the Quote and clicks the Run Workflow button to activate the approval process
2. Approval record initiation
Approval record is created automatically by the Workflow and assigned to the Sales Person team. The Approval decision status is ‘undecided’. The Approval’s note reflects the business process stage.
3. Sales Manager Notification
Each member of the Sales Manger team receives an email notification regarding the pending approval task. The email notification includes a link to the Approval record.
4. Sales Manager decision
Sales Manager edits the Approval record and change decision to Approved and saves the Approval record
5. Approval record Status
The Approval record is assigned to the CFO team and decision value is again defaults to ‘Undecided’. The Approval record notes reflect the business process progress.
The CFO team members receive an email notification regarding the pending approval.
6. CFO approval
CFO team member decides to approve the discount % and changes decision to ‘Approved’. The approval record is assigned back to the Quote owner and its state changed to Inactive, as this is the end of the business process. The Quote owner receives a email notification regarding the approval granted.
The solution is packaged as a Microsoft Dynamics CRM 2011 Solution which can be downloaded here. This is a managed solution and before you activate it in your environment you will have to edit it in order to adapt some elements like users or teams. Following are the solution components:
- Quote entity customization – One custom attribute which is not visible in the entity form and is used to indicate if a Quote record is currently in an approval process
- Approval entity customization – Custom entity which represents the approval process data and process
- Quote Approval Process: Main – Main workflow rule which defines the approval process flow. It uses child workflows to implement repetitive logic. Before activating this rule, make sure you replace the Team/User with principals in your organization
- Quote Approval Process: Approval Stage – Child workflow rule which encapsulates approval process stage
- Quote Approval Process: Approval Granted – Child workflow rule which encapsulates approval granting logic
- Quote Approval Process: Finalize – Child workflow rule which finalizes any approval process logic
- Quote Approval Required notification – An email template used to notify a user that an his attention is required
- Quote discount % approved notification – An email template used to notify a user about a Quote discount % approval event
- Quote discount % disapproved notification – An email template used to notify a user about a Quote discount % disapproval event
- E4D.CRM.Plugins.Approval – A plugin component used to send an email notification the team members in the event of Approval record assignment