Scenario Overview
In this scenario our business requirement is that when an Account is deactivated all associated Contact records are also deactivated. Additionally, if the Account is subsequently reactivated then reactivate the Contact records.
North52 Decision Suite Solution
The North52 Decision Suite solution works like this,
- We create a Process Genie formula that is triggered when the Account status changes
- The formula retrieves all the Contacts associated via the parentcustomerid field on the Contact entity
- It then loops over all the contacts and changes the Status from Active to Inactive or from Inactive to Active
North52 Decision Suite Steps
The following set of steps will set this formula up:
- Create a new formula of type 'Process Genie'
- Set the Source Entity to 'Account'
- Copy & paste the formula below into the formula description field and click save
- Create a new workflow process for the Account entity which is started when the 'Record status changes'
- Add a N52 Process Genie step and add the Formula Short Code to the properties
- Publish the workflow and test
Formula
ForEachRecord(
FindRecords('contact', 'parentcustomerid', [account.accountid], 'contactid'),
UpdateRecord('contact',
CurrentRecord('contactid'),
Case([account.statecode],
When(0), Then (SetAttribute('statecode', '0|1')), /*Active*/
When(1), Then (SetAttribute('statecode', '1|2')), /*In-active*/
Default('NoOp') ) ) )
Wizard - FindValue
Please see below the wizard you can use to create the FindValue() function call used in this formula.
Note that to find the Equals Value field here, you will need to go to Explore > Entities > Account > Account