Jennifer Lee and Stacy O'Leary in a new episode of "How I Solved It"

How I Solved It: Manage Contacts Who Have Changed Jobs

By

Welcome to another post in the “How I Solved It” series. In this series, we do a deep dive into a specific business problem and share how one #AwesomeAdmin chose to solve it. Once you learn how they solved their specific problem, you’ll be inspired to try their solution yourself! Watch how Stacy O’Leary gives users a fast and easy way to update Salesforce when a contact moves to a new company.


Key business problem

As a Salesforce Admin, one of the most important jobs you have is to make sure your org’s data is accurate and clean. Doing this minimizes the amount of time your users spend hunting for information or calling people who aren’t really prospects, and can even reduce frustration in your prospects and customers. As admins, however, we don’t always know if data is accurate, which is why we sometimes need help from our users.

When a contact in Salesforce changes jobs, we want to capture that information accurately in Salesforce, without losing any data. We also want to make sure we don’t have any misaligned data. A Contact record can have a lot of things tied to it: emails logged, campaign membership, form fills, etc. Deleting the Contact isn’t right—there might be relevant old case records or emails that we want to keep a record of, tied to the right person. Changing the Account lookup on the Contact to the new Account isn’t right either, because all that old data still needs to be tied to the old Account and the old Contact record.

We need to preserve the old information while also creating a new record for future use (especially if the contact is a potential prospect at their new company).

How I solved it

I solved this by creating a screen flow that’s launched by a custom action on the Contact page. Let’s take a look at our contact, Sarah Murphy. Our company’s top-selling account executive (AE) calls Sarah to talk about a new product launch. Sarah informs our AE that she’s left ABC Corp and now works at XYZ Corp. The AE thanks Sarah for letting her know and writes down her new contact information. At this point, the AE knows that the information in Salesforce is now incorrect, but nobody else (including the admin) knows. So, what do we do now?

A diagram of the record relationships between Account, Emails, Opportunities, Contacts, and Campaign Membership

This is where our “Move to New Company” flow enters the picture. Our AE can simply navigate to Sarah’s contact record in Salesforce and click Move to New Company.

Sarah Murphy’s contact record, featuring a custom button called “Move to New Company”

The AE can easily enter the new contact information for Sarah.

The screen a user sees when moving a contact to a new account record

And, they can click the link to navigate to the new contact record, and log their call.

Success screen the user sees after the new contact has been created, including a link to the new record

 

The AE doesn’t have to do anything to update the old record—it’s all handled via the flow.

The old contact record for Sarah Murphy displays a text banner. In large, bold, red letters, the banner reads, “This person no longer works at this company.” and shows the Status, Do Not Call, and Email Opt Out have changed

The new contact record for Sarah Murphy displaying new, updated field values

Do try this at home

Let’s take a look at how to build this easy flow with just five elements.

1. Start with a screen flow.

2. Add a Get Records element to get the original Contact record.

A Get Records element in the flow, for the old Contact record

3. Create the first screen element your users will see. This is the main screen the user will interact with, so consider adding instructions for the user or any additional required fields that the user needs to fill out. Because we’re creating a new Contact record, we want to set New Account, First Name, Last Name, and New Email fields to be required. Title and phone are optional in this example.

 Screen flow for the first screen the user sees; provides fields for the user to enter new data regarding this contact

4. Add a Create Records element to create the new Contact. You’ll notice that, in addition to the fields we asked the user for on the prior screen, we’re also populating Lead Source and Status. Status is being set to a default value, and Lead Source is being set to the same as the old Contact.

A Create Records element displaying all the fields that need to be populated on the new Contact record

5. Add an Update Records element to archive the old Contact record (since we don’t want to delete it).

An Update Records element that shows how the old Contact record is updated

The old record still needs to exist for record keeping, but we don’t want to use it going forward. With this in mind, we make sure to mark this person as opted out of email and calls, and set their Status to ‘No Longer At Company.’ Some companies use a Disqualified Status and a Disqualified Reason. If your org operates like this, be sure to set the proper values here.

6. Create the second screen element the user will see—the link to the new record. This node should include any final directions and have a link to the new Contact. In an earlier step, we used a Create Contact node, and a variable was automatically created for the new Contact record. We can use this to create a hyperlink to our new Contact. The hyperlink itself should consist of a forward slash immediately followed by the ID of the new Contact that was just created: /{!Create_New_Contact}. This way, your hyperlink will always work, even when you migrate this flow from your sandbox to production.

Adding a hyperlink to the display text

The formula to create the hyperlink the user will click on

The final screen that the user sees, which displays a completion message, and a link to the new Contact. In the Sandbox, the full URL is displayed for testing purposes.

7. Save and activate your flow.

All the elements in the flow

8. Navigate to the Contact object in Setup, and go to Buttons, Links, and Actions.
9. Click New Action and create an action for this flow. Click Save.

The custom action on the Contact object that launches the flow] 10. Add the button to the page layout or to your dynamic actions (depending on how your org is set up). 11. *OPTIONAL:* Add a rich text component to the Lightning page that clearly explains when the old Contact should no longer be used. A single rich text component with a component visibility filter is all you need to set this up to only show when the status of the contact is ‘No Longer At Company.’ [Image: Image.jpg][ALT TAG: The custom action on the Contact object that launches the flow

10. Add the button to the page layout or to your dynamic actions (depending on how your org is set up).
11. OPTIONAL: Add a rich text component to the Lightning page that clearly explains when the old Contact should no longer be used. A single rich text component with a component visibility filter is all you need to set this up to only show when the status of the contact is ‘No Longer At Company.’

The Lightning Page Builder showing how the rich text component is added

Business results

Now, no data is lost. Our AE is easily able to both update an old record and create a new record in a single step, and we provide clear and easy-to-understand directions for the end user.

A diagram of the record relationships of the old Contact and related objects versus the new Contact and related objects

Plus, you can easily tailor this flow to your particular business needs. If you have additional fields on the old Contact that need to be modified, or data copied from the old Contact to the new Contact, you can manage that all within this flow—without adding any extra work for your users.

I hope you find my solution helpful! If you’re just getting started learning about flows, this is a great one to practice with. And it goes without saying, but sandbox, sandbox, sandbox!

Reach out to me if you have any questions!

Resources

Want to see more good stuff? Subscribe to our channel!

SUBSCRIBE TODAY
How I Solved It with Jennifer Lee and Dee Ervin

Search Unsearchable Field Data Types | How I Solved It

Welcome to another “How I Solved It.” In this series, we do a deep dive into a specific business problem and share how one Awesome Admin chose to solve it. Once you learn how they solved their specific problem, you’ll be inspired to try their solution yourself! Watch how Dee Ervin searched unsearchable field data […]

READ MORE