Process Builder – Update Contact Address From Account

ZJ10

@ZacharyJeans is a Twitter machine (nearly 100K posts!).  So it’s good to see him roll up his sleeves and have a crack at Salesforce’s Trailhead learning challenges.

It can be hard work to get started, but social media can provide a lot of moral and practical support!

The actual problem that Zachary had to solve for his Trailhead challenge was the opposite of what I explained here.  In this example we have a contact which will refresh it’s address information from the parent account every time it is updated.  The Trailhead challenge called to update all child Contacts whenever the account was updated.  Good job I didn’t do his homework for him!

Here is the walk through which I wrote at the time.  I found it very interesting to see where someone new to Process Builder started with the tool.  Hopefully these pointers helped, I think they did as he tweeted later showing some of his new Trialhead badges!

Create New Process

Create the process and set it to fire on create & update of a Contact record.  Remember though that in a nice clean Salesforce environment, when the new Contact is displayed it defaults the address fields from the owning Account.  So this is more a scenario for updates.

ZJ1

Add Criteria

Depending on the scenario, you can set the filter conditions as needed.  Here I am working with just the street and postal code.  Thanks to the new feature in Process Builder, we can “OR” these conditions.

In a real situation my preference here would be to have a formula field checkbox outside of the process which I would used to model the criteria.  I’d call the field something like “Update Contact Address Required”.  But for now, let’s use the standard fields on the object.

ZJ2

Define The Update Action

With the criteria set, the branch to the action will be followed whenever they are true.

We need an action to “Update Records”, where the record will be the Contact record we are working with.  This can be slightly confusing when new to Process Builder, the trick is to click the name of the object and not get distracted by the list of the other fields:

ZJ4

Set Object Variables

Then set the Contact fields to come from the related Account fields.

Set each field, I have just updated the street and postal code.

ZJ5

Save, Activate, TEST TEST TEST!

You are going to feel so great when this runs and works first time!

Here’s my Account.

ZJ6

Here’s my new Contact with the street and postal code copied in by the process!

zj9

If it doesn’t work first time, then retrace your steps.  If it does run, don’t just go and have a coffee to celebrate, TEST SOME MORE!

Why?  Because there is a gotcha in here which will cause an error… can you find the cause?

ZJ8

After all, this is a computer program!

Good luck & enjoy the process…

 

….update.  The gotcha is that updating a contact which has no Account will cause an error.

The solution is to add an extra condition into the process filter to make sure that the update is only fired when an Account is listed for the current Contact.

2 comments

  1. Rupert Barrow · March 1, 2015

    Wow, real-time support-blogging 🙂 !

    Liked by 1 person

  2. SutoCom · March 4, 2015

    Reblogged this on SutoCom Solutions.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s