In this scenario our business requirement is that when an Accounts address is updated we need to update all the addresses of the related grandchildren Contact with the same data.
We will not sync the children Accounts for simplicity sake.
North52 BPA Solution
The North52 BPA solution works like this:
- We create a formula on the Account entity that triggers whenever the address1 fields change
- The formula retrieves all the children Accounts associated with this parent Account via the parentaccountid field on the Account entity
- The formula then retrieves all the children Accounts children Contacts (so the grandchildren of the original Account) associated via the parentcustomerid field on the Contact entity
- It will then loop over all the Contacts and update the address information with that of the grandparent Account
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, setting the following values in the Formula Guide:
- Source Entity set to Account
- Set Formula Type to Save - Perform Action
- Select the Classic editor
- Click Create
- Change the Name of the formula to Sync an Accounts Address with its grandchildren Contacts
- Set the Event field to Update
- Expand Source & Target and set the Source Entity Property to address1_line1, address1_line2, address1_line3, address1_city, address1_postalcode, address1_country
- Hold down control key to multi-select
- Copy and paste the following formula into the formula editor pane:
Iftrue(DoesNotContainData([account.parentaccountid] ), ForEachRecord( FindRecords('account', 'parentaccountid', [account.accountid], 'accountid'), ForEachRecordNested( FindRecords('contact', 'parentcustomerid', currentrecord('accountid'), 'contactid'), UpdateRecord('contact', CurrentRecordnested('contactid'), SetAttribute('address1_line1', [account.address1_line1]), SetAttribute('address1_line2', [account.address1_line2]), SetAttribute('address1_line3', [account.address1_line3]), SetAttribute('address1_city', [account.address1_city]), SetAttribute('address1_postalcode', [account.address1_postalcode]), SetAttribute('address1_country', [account.address1_country])))))
- Click Save
- You are ready to test
To test this formula, open an Account record that has child Accounts which have Contacts (Account > children Accounts > grandchildren Contacts).
Update the grandparent Account address fields and you will see the update occur in the grandchildren Contact.
Did you know?
North52 Decision Suite works with vanilla Common Data Service instances
The North52 Decision Suite works with Common Data Service instances which have not had any Microsoft 1st Party apps applied (Field Service, Customer Service, Sales Enterprise, etc). This means you can use our no-code advance business rules engine in your custom Model Driven and Canvas Power Apps!
It is the same solution which has been powering Microsoft Dynamics 365 CR/CE for many years. You get a mature, robust solution with proven capabilities (over 500 functions) that allows you to build complex decision logic for use in your custom apps.