Scenario Overview
In this scenario the business requirement is that when a user sets a boolean field 'Credit Check Contacts' to true on the Account record it will execute a workflow on each active associated contact record.
North52 Decision Suite Solution
The North52 Decision Suite solution works like this,
- A formula is created which executes whenever the 'Credit Check Contacts' field changes
- The formula first checks to see if the field is set to true
- If so it retrieves all the related active contacts
- It loops over the contacts & executes the 'ProcessCreditCheck' workflow for each contact
North52 Decision Suite Steps
- Create a new formula of type 'Save - Perform Action'
- Set the Event to 'Update'
- Set the Source Entity to 'Account'
- Set the Source Property to 'Credit Check Contacts'
- Copy & paste the formula below into the formula description field & click save
- You are ready to test
Formula
if([account.new_creditcheckcontacts] = true,
ForEachRecord(
FindRecords('contact',
SetFindAnd('parentcustomerid',
'statuscodecode'),
SetFindAnd([account.accountid], '1'),
'contactid'),
ExecuteWorkflow('ProcessCreditCheck', CurrentRecord('contactid'))
)
)
Wizard - FindRecords
Please see below the wizard you can use to create the FindRecords() function call used in this formula.
Note you should copy and paste the SetFindAnds into the wizard for simplicity's sake.