How To

Highlight Account Record Attributes on the Contact Record [Lightning Experience]

FeaturePremierClient.GIF

This is the first of four separate posts that will cover each record attribute shown on the flow screen on the Contact record. Please read the blog post “Highlight Record Attributes Using Flow [Lightning Experience]” which provides a high level overview of the individual posts.

Here are a few lessons learned from implementing this use case:

  • Learn how to use flow to lookup and display data via an embedded flow component on a Lightning record page.
  • Provide descriptions, where provided, in Salesforce. This may be tedious step, I know, but your future self will thank you when you are trying to remember what you configured or assist other/future admins when troubleshooting or enhancing what was built. This includes variables, the purpose of a flow, what each flow element does, etc.

Business Use Case:  Addison Dogster is the system administrator at Universal Containers. Steven Moon is the Director of Sales. He wants his sales reps and support staff to know whether the Contact they are interacting with is that of a premier account. Currently, reps and support staff will not know unless they go to the Account record.

Solution: While Addison could have easily added a formula field that looks at the Premier Client field on the Account record, this field would not be highlighted to the sales rep or support staff. They would need to know where this field is on the Contact record page. Being the #AwesomeAdmin that Addison is, she was able to solution this creatively using flow screens and embedding the flow component on the Lightning Contact page to highlight this field in its own panel and not create another custom field on the Contact object.

Premier client is a checkbox on the Account object. If checked on the Account, the Premier Client? checkbox is checked in the flow screen. Premier Client was checked on the Burlington Textiles Corp of America account and therefore, the “Premier Client?” checkbox is checked on Edna Frank’s and Jack Roger’s contact records, since they are contacts associated to the Account.

Account-PremierClientPointOut.GIF

AdditonalContactDetails-PremierClient.gif

Taking a look back at the consolidated flow, the highlighted boxes are the ones that pertain to this implementation only, along with the GenericSendEmailOnFault subflow.

AdditonalContactDetails-Flow-PremierClient.GIF

Quick Steps:

1. Create a custom checkbox field on the Account Object called “Premier Client.”

In Lightning, under Setup, in the Object Manager tab | Account  | Fields & Relationships. When in doubt, use the Quick Find to search.

Best practice tip: Don’t forget to provide a description so you and other/future admins know what this custom field is used for.

PremierClient.GIF

2. Let’s create a visual workflow to lookup the contact’s account ID, then look up the Premier Client checkbox value for the account to display the value on screen.

AdditonalContactDetails-Flow-PremierClient-Revised.GIF

In Lightning Experience, it is found under Process Automation | Flows.

A. Let’s create our flow resources upfront.

Best practice tip: Don’t forget to provide a description so you and other/future admins know what these flow resources are used for.

This variable will store the contact Id that is passed from the flow. Note: for embedded flows, the record Id is passed with this exact variable name, “recordID”. Note: The input/output type needs to be Input Only for the flow to work when called from the flow component.

 recordID.GIF

This variable will store the contact’s associated account ID.

varAccountID.GIF

This variable (boolean = checkbox) will store the value of the account’s premier client. By default, I am setting this as false.

varAccountPremierClient.GIF

B. Let’s lookup the Contact’s account ID using the Record Lookup flow element on the Contact object where the Id is the value passed from the flow component into the recordID variable. Then, we take the value in AccountID field and store it in the variable varAccountID.

Best practice tip: Don’t forget to provide a description so you and other/future admins know what this record lookup is used for.

AdditonalContactDetails-Flow-PremierClient-RecordLookupContact.GIF

C. Now, we are going to create another Record Lookup flow element on the Account object where the Id matches the value in the variable varAccountID. Then, we take the value in the Premier Client field and store it in the variable varAccountPremierClient.

Best practice tip: Don’t forget to provide a description so you and other/future admins know what this record lookup is used for.

AdditonalContactDetails-Flow-PremierClient-RecordLookupAccount.GIF

D. Next, we will create a Screen flow element to show the Premier Client value.

Best practice tip: Don’t forget to provide a description so you and other/future admins know what this screen is used for.

Ensure that under Navigation Options, that you select the option “Don’t show Finish button.” and uncheck the “Show Pause button.”

Then, tab to the Add a Field tab, find the checkbox and drag it to the screen area on the right. Then double-click on the checkbox field and configure it to match the screen below. For the Default Value field, you want to reference the variable varAccountPremierClient.

AdditonalContactDetails-PremierClient-ScreenJEN.gif

E. Add the subflow Send Flow Fault Email. For instructions on how to create this, go to Step 2 of blog post: Maximize Maintainability With Process Builder and Componentized Visual Workflow.

AdditonalContactDetails-Flow-PremierClient-Subflow.GIF

F. Set your flow starting point. And connect the flow elements and the fault connectors to match the below…

AdditonalContactDetails-Flow-PremierClient-Subflow1.GIF

G. Save as and provide the following properties.

Best practice tip: Provide a description so you and other/future admins know what this flow is.

AdditonalContactDetails-Flow-PremierClient-Properties.GIF

H. Click the “Close” button.

I. On the flows screen, activate the flow.

AdditonalContactDetails-Flow-PremierClient-Activate.GIF

3. Finally, we need to add the flow component to the Lightning Contact record page. Find the Flow component under the Standard components and drag it to the desired location on the Contact record page. Then, select your flow and check the box that you want to pass the recordID into the flow.

AdditonalContactDetails-AddFlowComponent.gif

Congrats, you made it to the end! You’ve implemented a flow that takes data from the associated Account and shows it on the Contact record.

Now, before you deploy the changes to Production, don’t forget to test your configuration changes.

  1. Check the Premier Client checkbox on the Account record.
  2. Navigate to an associated Contact record. Verify that the Premier Client checkbox is checked.
  3. Now, go back to the Account and uncheck the Premier Client checkbox.
  4. Navigate to an associated Contact record. Verify that the Premier Client checkbox is unchecked.

Deployment Notes/Tips:

  • The flow, custom user field, lightning record page can be deployed to Production in a change set (or can be deployed using a tool such as Dreamfactory’s Snapshot).
  • Don’t forget to set FLS on the profile for the custom account field Premier Client.
  • You will find the flow component in a change set under the Flow Definition component type.
  • You will need to confirm that all the configuration of a lightning record page change set deployed as expected.
  • Activate the flow as they are deployed as inactive in Production.