The Non-Profit Success Pack has some Apex code that pulls the billing address from Households to associated Contacts. This week I was assigned the task of pulling the shipping address to Contacts as well. Since it’s a managed package that code can’t be modified so I had to find another option.
I consulted with my father and brother (both of whom work with Salesforce). We determined that Workflow rules were inappropriate because they can’t be used to update fields in child records. Formulas weren’t appropriate either. Flows and Process Builder were the remaining options. Process Builder being simpler to set up we determined that it was the best course of action.
So here’s how you do it.
- Create a checkbox in Contact called “override automatic flow”
- Start a new flow in Process Builder.
- Give it an appropriate name.
- Choose Account as the Object.
- Select “when a record is created or edited”.
- Go to Criteria and give it a name.
- Select Conditions are met.
- Set a condition as [Account].RecordType.DeveloperName = String = HH_Account
- Open an Action Group that updates a field. Give it a name.
- Choose Contacts as a record to update.
- Filter the record based Override Automatic Flow being the Boolean value false.
- Set the fields you wish to update. Essentially this will be Other City, Reference, [Account].ShippingCity et cetera.
- Activate the flow.