Forum Discussion

Claudius's avatar
5 years ago

Salesforce email search profile link

If you have staff from the customer success, support, or similar departments engaging on your community and you are using Salesforce CRM it can be handy to quickly obtain more information about users posting on the community. Of course there is the full blown About the Salesforce and Khoros integration which can be used for that. Sometimes a simple contact search on SFDC already works wonders.

Enter a lightweight Salesforce search "integration". It's basically just a link to search on Salesforce for the email address of the user. Such link fits well - usually hidden behind a staff role check - on the community user profile page (a.k.a. ViewProfilePage). The id of the viewed user can be obtained from ${page.context.user.id}. You might need to adjust the source of the user id when you want to use it on a different page context.

Salesforce Lightning

For the newer (talking in year 2020 terms here) Salesforce Lightning Component Framework use the following code which transfers the search details base64 encoded.

 

<#assign userEmail = restadmin("/users/id/${page.context.user.id}/email").value>
<#assign SFDC_Lightning_Search = '{"componentDef":"forceSearch:search","attributes":{"term":"' + userEmail + '","scopeMap":{"type":"TOP_RESULTS"},"context":{"disableSpellCorrection":false,"SEARCH_ACTIVITY":{"term":"' + userEmail + '"}}}}' />
<a href="https://<salesforce_instance>.lightning.force.com/one/one.app?source=aloha#${utils.base64.encode(SFDC_Lightning_Search)}" target="_blank">Search email in Salesforce</a>

 

 

Salesforce Classic

For the older Salesforce Classic search use the following url where the email is url encoded and sent as an url parameter:

 

<#assign userEmail = restadmin("/users/id/${page.context.user.id}/email").value>
<a href="https://<salesforce_instance>.salesforce.com/_ui/search/ui/UnifiedSearchResults?searchType=2&sen=001&sen=00Q&sen=003&sen=500&sen=a0C&sen=005&sen=701&str=${userEmail?url}#!/fen=001&initialViewMode=detail&str=${userEmail?url}" target="_blank">Search email in Salesforce</a>

 

Bonus

To make this link more recognizable you can add the following Salesforce SVG icon within the anchor link:

 

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="height: 24px; fill: #1798c1; vertical-align: middle;"><path d="M10 5.5c.8-.8 1.9-1.3 3.1-1.3 1.5 0 2.9.9 3.7 2.2.6-.3 1.3-.5 2-.5 2.9 0 5.2 2.3 5.2 5.2s-2.3 5.1-5.2 5.1h-1c-.6 1.1-1.9 1.9-3.3 1.9-.6 0-1.2-.1-1.7-.4-.6 1.5-2.1 2.6-3.9 2.6-1.9 0-3.5-1.1-4.1-2.8-.3 0-.6.1-.8.1-2.2 0-4-1.8-4-4 0-1.5.7-2.8 1.9-3.5-.2-.5-.3-1.2-.3-1.8 0-2.6 2-4.7 4.6-4.7 1.6.1 3 .8 3.8 1.9"></path></svg>

 

 

If you have come up with links to other CRM searches please share them with your fellow Khoros community developers.

No RepliesBe the first to reply