Following on from my previous post about Microsoft Flow vs Dynamics 365 Workflows, this time we are looking at the built in workflow engine in Dynamics 365 Customer Engagement.
Workflows are the bread and butter of most consultants/Power Users/System admins who want to make the system do something it doesn’t by default. The workflow engine is a fantastic tool in Dynamics 365, it can be used to automate functionality, restrict functionality, create records, update records, send email. These are just some of the basic functions, there are also actions and custom actions which can do things like qualifying leads and customise that process involved.
As with my previous article, i’m going to go through the process of creating an approval engine to approve a quote if the discount is beyond a certain level.
We’re going to set up a realtime workflow which will check the discount percentage, when this changes, check the level of discount. When this level is above a certain amount, we’re going to change the field “Approval required” to yes.
Then we are going to send an email to the approver. The approver can be setup in multiple ways, we could set them up and specify them in the workflow, we can lookup the manager of owner of the record (if that’s setup in Dynamics) or we could set up teams and a distribution mailbox to send the email to. In my opinion, creation of a team and a distribution list would be the best way to handle the administration overhead.
The other reason for creating a team in Dynamics is we are going to use some Field security fields for the approvals, and this is generally easier to maintain. We can setup a field security profile and match them to a field or multiple fields on a quote form.
Whereas with Microsoft Flow, we could approve and update D365 directly from an email, for the D365 Workflows, we need a mechanism to approve/not approve and restrict other people from approving. Meaning we don’t actual need the approval fields on the form for Microsoft Flow, we do need a button on the form for the Workflow engine.
To do this we need to create some Field Security fields on the quote form. We create the Field Security fields as two option option sets, set them as field security fields and put them on the form. You can create as many levels of approval as your required, a typical setup could be Sales Director and CEO approvals but it’s down to the business processes. You also need to create field security profiles and link them to the newly created fields.
Make sure to add either your teams or users to these profiles so they can update them. Next we need to mechanism to update the approval required field and for good measure, we should also update a field to tell us when the quote was approved.
Create another workflow which runs on update of the approval fields.
This workflow checks when the approval is done, and updates the time so you can see when it was approved. There is an additional check to ensure that the Sales Director still has the ability to approve this quote. It looks like this:
This can be done differently and more robustly if you require multi level approvals, creating other fields to see if further approvals are required, buttons to create and send emails to higher level approvers if you want to skip a level, fields which show which level of security is required. There are loads of possibilities!!
This is part two, and if you have been following along closely you will have noticed a key piece of information I’ve left out of both part one and two. Guess you’ll have to come back for part for the stunning conclusion!
Ciao for now!