Automatic Record Creation and Update Rules
While you are working with cases in Microsoft Dynamics 365 there is always a need to automatically create cases based on defined business rules and from multiple channels like email, chat, etc. In earlier versions of Microsoft Dynamics CRM this was achieved via Custom Workflows. There are many articles available on the web that shows you how to do that. Now, this can be achieved with no knowledge of workflows and in less time. While this feature can be used to automatically create or update cases, leads, opportunities, appointments, tasks and more records from incoming activities; in the next section, we’ll explore specifically how to create automatic case creation rules using the Automatic Record Creation and Update Rules functionality.
To create automatic creation rules you need to make sure that you have the correct version. This feature was introduced in CRM Online 2015 update 1, and CRM 2016 (on-premises). Be sure your external application/social engagement system is already integrated with your Dynamics 365 instance (permissions set within Microsoft Dynamics 365 server side sync is setup properly. Make sure your user profile contains either System Administrator, System Customizer or Customer Service Manager, Sales Manager, or Marketing Manager roles. Go to Settings > Service Management (or Business Management) and click on Automatic Record Creation and Update Rules.
Create a Rule
Once you have taken care of pre-requisites then go to Settings > Service Management (or Business Management) and click on Automatic Record Creation and Update Rules.
Your view will show you the list of existing rules. If you would like to edit an existing rule then simply select the desired rule and click Edit on the command bar. To create a new rule click on the + New button on the command bar.
Now, it is time to fill in the information that is necessary to make the rule work. Let’s look at each of the attributes or fields on this rule form.
Name – Represents a unique name for the rule. In my example, I named it as Vehicle Claim by Email a combination of queue & channel.
Source Type – Select the activity that is the source for the record you are creating. These activities can be converted to any default (system) entity records or custom entity records. For our example, we’ll select incoming Email activities to automatically create a case.
Queue – Select the queue that is applicable to this rule. In a record creation and update rule, when you specify a queue for a source type, any incoming activity from that source is added as a queue item for that specified queue. So if a rule for a particular source activity and queue combination is active, the rule processes the incoming activity on that queue to create or update records.
For our example rule, we have selected Vehicle Claims Queue. NOTE: If your source type is email then make sure the email address that we are using for this rule is specified in the selected queue otherwise a case will not be automatically created. For an email source type, specifying a queue is mandatory. For all other source types including custom activities, it is optional.
Owner – Defaults to who is creating the rule.
Under Channel Properties click a channel property group. Every default or custom activity has an Additional Parameters attribute. This attribute stores the JSON payload received from an external application. You can find these parameters in the Additional Parameters field of any incoming activity. To capture this information in Dynamics 365 and associate it with the record creation or update rule, you can define channel properties in a channel property group and associate them with a rule or share them across multiple rules. When you select a property group for a record creation and update rule, you can use the channel property group’s property items in the rule item conditions or while setting properties for the target record. After you activate a rule, you can’t remove or change the selected property group. You can select another property group only after you remove the referenced property items of the previous property group from the rule items. When you try to select a new property group without removing the property references of the previous property group, you’ll see an error.
Since our example is using the source type of Email, we also need to specify conditions for converting the email to the target record which in our example is the Case entity. Let’s look at each option in a little more detail:
- Create records for email from unknown senders – all email messages from senders that don’t have an email address in Dynamics 365 are converted to new records. A contact record is also created.
- Create case if a valid entitlement exists for the customer – selecting this option creates a case only if an active entitlement exists for the customer. If the sender’s email is found on a contact with a parent account Dynamics 365 creates a record if that parent account has a vaild entitlement and the contact is listed in the contacts section of that entitlement, or the contacts section of the entitlement is empty.
- Create cases for activities associated with a resolved case – if you select this check box, Dynamics 365 creates a case if the email is related to a resolved case. If the email is related to an active case, a new case won’t be created.
- Create cases for activities associated with a resolved case since– If the create cases for activities associated with a resolve case option was selected you will set the duration in this field. Dynamics 365 creates a case only if the case is resolved earlier than the duration you specify. If the incoming email is related to a case resolved later than the specified duration, Dynamics 365 only associates the incoming email with the existing resolved case; a new case won’t be created.
- Send automatic email response to customer on record creation – select this check box if you want to automatically send email responses to the sender of the email after a target record for the email is created.
- Select email template to respond to customer – If you select the send automatic email response to customer on record creation check box, select an email template (global email template or email template of any entity type). If you don’t select a template, an automatic response won’t be sent.
Specify Record Creation and Update Details
Once we have all our definitions in place for the rule, we’re ready to set-up any additional conditions for creating our records, as well as what type of records we want to create. Click the + to begin setting up these conditions and actions of the rule. For our example, we want to create a case every time an e-mail with a subject containing the word vehicle, or if the sender’s account is associated with Northwind Electric Cars.
Under Actions choose the type of record to create. For our example, we will choose to create a Case record and Set Properties to pre-populate any of the fields for the case record.
Additionally – under the Specify Other Actions section you can click Add Step to create a record, update a record, send email or start a child workflow.
Once completed click Save and Close.
Activate the Rule
From the command bar – click Activate on a rule to enable it. Once a rule is activated the only way to edit it or modify it is to first Deactivate it.
You can have two record creation and update rules active at a time for any source type; one with a queue and one without a queue. The exception to this is the Email source type. You can have only one record creation and update rule active for the source type Email, and this rule must have a queue specified.
Create automatic creation rules in combination with routing rules to automatically create cases and route them to appropriate users or queues for quick and timely distribution of cases to your service professionals.