In this scenario our business requirement is that when a user in on the contact entity and changes the parent account (Company) field then all the Contact Preferences details from the new parent account needs to be copied down to the contact.
[Change the Company field on the form (i.e. onChange event invoked)]
[Then all the Contact Preferences from the new Company are copied down to the Contact record.]
North52 Decision Suite Solution
The North52 Decision Suite solution works like this,
- We create a client-side only formula that fires for just when the Company Name lookup field changes
- The formula itself retrieves all the contact preferences associated via the Company Name (i.e. parentcustomerid) field on the contact entity
- It then matches & sets each of the field names & values
North52 Decision Suite Steps
The following set of steps assumes you are just using the out of the box Dynamics 365 setup. But its easy to enhance if you have extra fields \ requirements.
- Create a new formula of type 'ClientSide - Perform Action'
- Set the Event field to just 'Create & Update'
- Set the Source Entity to 'Contact'
- Set the Source Entity Property to 'Company Name'
- Copy & paste the formula below into the formula description field
- Click Save
- Click N52 Commands on the command bar & then click 'Publish Formula'
- You are now ready to test
MultipleClientSide( SetClientSideField('preferredcontactmethodcode', ToString(FindValue('account', 'accountid', [contact.parentcustomerid], 'preferredcontactmethodcode', '2'))), SetClientSideField('donotbulkemail', ToString(FindValue('account', 'accountid', [contact.parentcustomerid], 'donotbulkemail', 'false'))), SetClientSideField('donotemail', ToString(FindValue('account', 'accountid', [contact.parentcustomerid], 'donotemail', 'false'))), SetClientSideField('donotphone', ToString(FindValue('account', 'accountid', [contact.parentcustomerid], 'donotphone', 'false'))), SetClientSideField('donotfax', ToString(FindValue('account', 'accountid', [contact.parentcustomerid], 'donotfax', 'false'))), SetClientSideField('donotpostalmail', ToString(FindValue('account', 'accountid', [contact.parentcustomerid], 'donotpostalmail', 'false'))) )
Wizard - FindValue
Please see below the wizard you can use to create the FindValue() function call used in this formula.
Note 1: that to find the Equals Value field here, you will need to go to Explore > Entities > Contact > Company Name
Did you know?
North52 has over 500 functions to help you implement advanced business rules and complex decision logic
The Formula Manager, part of the North52 Decision Suite is a business rules engine that aims to eliminate this custom coding by using simple formulas instead. It is significantly faster (up to 10 times) than writing custom code and you get the added bonus of lower cost updates if a business rule changes in the future (it is much faster and thus cheaper to change it using a Formula rather than custom code).
There are over 500 functions available in the North52 Decision Suite business rules engine!