Add or Subtract from Account Fields when Contact Fields are Updated in Microsoft CRM
Posted on: January 9, 2018 | By: Jim Bertler | Microsoft Dynamics CRM
Authored by: John Hinchy
Within Microsoft Dynamics, there are many tools that can be used to avoid using custom code or development. A scenario we recently came across was that a company wanted to show how many of their employees had a number of different attributes and accomplishments related to their profile. They had about 15 different data points where they wanted to show the collective number of attributes at the account level. Say for example they had a check box on the contact for if a person held a Master’s Degree. If checked this would reflect at the account level. So, if 7 employees had this box checked, then the account would show a 7 for Master’s Degrees field. Ideally you would use a rollup field to accomplish this. Rollup fields are very useful and can show a count of records at the child or contact level.
The problem that we ran into, and isn’t widely known among the Microsoft Community is that you are limited to 10 rollup fields per entity. So, once you reach your ten, you need an alternative solution, and one method to use that doesn’t involve code is a workflow that can increment and decrement (Add & Subtract) a number on that Account form when a child record changes. In this blog, I will demonstrate how to do this.
First create a new field on your account form. Data Type will be Whole Number and Field Type will be simple. In our example, we will call the field ‘Master Degrees.’ Save, Publish, and place this field on your account form.
Now, on our contact form we need to create a Yes/No check box. This check box will trigger our workflow to update the account form. I would suggest using a check box format for the two option field. You can do this through the formatting tab on field properties. Save, publish, and add to your contact form. Now you are ready to create your workflow.
To do this go to settings- processes and click new. Then, give your process a name, choose category workflow, and entity contact.
Now, choose Start When: Record is created or Record Fields Change. The field in this case is called Master’s Degree.
Click Check Condition for your first Add Step.
The condition is Contact: Master’s Degree: Equals: Yes.
The next step is update record. Here you will Update: and select Company Name to update the Account field.
From here you will use the operator function and choose Increment By.
Select 1 as the Default Value.
Ensure that Increment by 1 is selected in the Master’s Degree field.
Click Save and Close.
Now use a conditional branch to set your otherwise statement. This is a little tricky and shown in the picture below. You will set Contact: Master’s Degree: Equals No OR Contact: Master’s Degree: Does Not Contain Data. Then choose Company Name (Account): Master’s Degree: Does Not Contain Data, all grouped by an And statement. Save and Close.
Now do the same thing you did to Increment by one but choose Decrement on the same field.
Lastly and importantly, convert this to a real-time workflow. This will allow the workflow to fire correctly when importing records. Save and Activate and you are done!
If you think that a CRM system is your next best step for your business, Logan Consulting your Microsoft Dynamics CRM partner of Chicago.
How to Double your ROI with Cloud Solutions
Top 10 Inventory & Operations Decisions Distributors Are Making Blind
2020 Nucleus Research Report on ERP Technology