Recently I got a chance to explore this while doing a small POC for one of my customers. And boy! I liked it. All this time I was hearing about this and also watched the MSDN video. But nothing is true experience until you get a first hand experience of it.
Here was the scenario for our customer. The customer has a social engagement portal which tracks the posts in the social engagement channels (like Facebook, Twitter, Linkedin etc) and feeds the JSON response to an activity in the form of JSON response. From the JSON response, we had to create a contact. So we had two options here.
- Parse the JSON response and write some interface that would create the contact in CRM after parsing the JSON from the portal. This can be achieved by using SDK and JSON parsers like Newtonsoft.json.dll.
- Use the ‘Automatic record creation and update rules’ feature that comes along with Dynamics CRM 2015 Online update 1
If something is present OOB, why re-invent the wheel. And also with configurations the advantage is the maintainability since you can get away with the engagement of a developer for any kind of changes/ fixes in the code.
First of all, I created a custom activity of called – ‘Social Engagement Activity’. To identify the channel from where the activity is created, I created a custom field ‘Activity Channel’ to determine the social channel from which the activity is created.
The following is the json output from the social portal. Off-course we have lot more values. However for an example I am presenting a simplified version of the json we are getting.
- Now go to Settings –> Service Management –> Automatic Record Creation and Update Rules.
- Create a Record Creation Rule.
- Enter the basic information for the rule
- This is extremely interesting. Now create a new channel property. These are the properties that will be mapped to the JSON properties that I specified earlier in the Activity Additional Parameters’ field.
- Create the Channel Property corresponding to each property of the JSON output. Remember the property names are case sensitive. Since my JSON input contained three parameters FirstName, LastName and Email, I have created the same three channel properties below.
- Now the next step is to specify the rules for record creation. Go to the rules creation section and click to create a new rule.
You can specify the conditions but in my case no condition was needed. Now comes the important part. When we set the properties of the contact, in the form assistant you will see the channel properties you created. So I map the contact fields with value from the channel properties.
Now we need to activate the rule. And you are done with the settings.
- Now I go ahead and create a new ‘Social Engagement Activity’ record. with the values specified below.
ideally this should be created from the social portal.
- And voila, the contact record is created. Isn’t it great!
I have just given a simple example here but I guess with the features provided you can leverage it to build complex functionalities.
Hope this helps!