For one of my projects, there is a requirement that the support staff be able to specify the Contact’s status for that relationship via a picklist, such as active and inactive. There are three possible relationships a Contact can have with our company. There is another requirement by the support staff for the other relationships to see a 360 view of the Contact (i.e. see if a Contact has other relationships with our company), but they did not want to have to look at the three status picklists to determine whether there was a relationship (i.e. picklist has a value). The immediate reaction of the Developer was to create three new checkboxes for each relationship. This seemed like a waste of three custom fields, plus there wasn’t a way to easily highlight this on the Contact record page. I wondered if there was a way to use flow screens to do this. Rather than have the user interact with the flow screen, instead I can have the flow do the query and present the data as three checkboxes. This solution highlighted the relationships in its own section of the page and eliminated the need to create more custom fields on an object that will grow over time.
Rather than show what I built specifically for the project, I’m going to show a solution that uses flow and the embedded flow component to highlight various different record attributes in its own section on the Lightning record page. (Sorry, Classic users, this is a Lightning Experience only use case/solution!) I’m hoping by seeing what is possible, this can get your creative juices going on how you can use this solution for your own use cases.
This is the flow component on the Contact record page.
This is the flow. It’s actually not that complex, especially if you don’t want all four record attribute information to show.
Here are the four different record attribute information: premier client data pulled from the Account record, whether the Contact is a primary Contact from the account contact role (note: You can only specify the account contact’s role in Classic. This is currently not available in Lightning Experience), associated open cases and associated open opportunities via opportunity contact roles.
I’m going to take a different approach than previous posts where I walk through the entire solution. Instead, I’m going to take pieces of the one consolidated flow and do my normal step-by-step for each record attribute section so that if you only wanted one, two or three of the pieces but not all, you know what you need to build from the complete one to make that one section work.
So, there will be four separately published blog posts in the upcoming weeks.
In the meantime, here are GIFs to show you the end result of what we (or Addison Dogster) will be building…
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.
The flow will query the Account Contact Relationship (this is a new object created when you enable the feature Associate Contact to Multiple Accounts* in your org) for the direct contact and if the custom field Is Primary is checked, then the “Primary Contact?” checkbox on the flow screen will be checked. In the example, Jack Rogers and Edna Frank are direct contacts for the Burlington Textiles Corp of America account. Jack is the primary so the “Primary Contact?” field is checked on his record but not on Edna’s.
*Note: If you are currently using Account Contact Roles and have transitioned to Lightning Experience, there are no future plans to migrate the Account Contact Roles feature to Lightning Experience. Salesforce recommends that you use the Associate Contact to Multiple Accounts feature.
Open cases associated to the Contact are shown in the flow screen with the “case number | subject” along with the count of all open cases.
The flow screen queries whether the Contact is associated to an opportunity (i.e. has an opportunity contact role) and for any found, will then find all the open opportunities (i.e. stage is not Closed Won or Closed Lost) and show them as “opportunity name | opportunity stage” with a count of all open opportunities.
Note: Flow components do not currently refresh to the start when a record is updated. It does require a page refresh to see the updates, if you are already on the Contact record. However, based on this Twitter thread, this may be something that Salesforce delivers in a future release. #ForwardLookingStatement
I think, for now, the need to page refresh isn’t a big deal since if you just updated the record or created a case or opportunity from the Contact record, you don’t really need to see that the Additional Contact Details section updated. It will update for the next person visiting the Contact record.
However, if you need flows to automatically refresh upon update, fellow MVP Doug Ayers created a workaround with a lightning component and VF page. Thanks, Doug!