TransWikia.com

Formula field - Hyperlink to record page (SF and Community)

Salesforce Asked by Ricardo Coutinho on November 28, 2021

I have a formula field that displays a text and has a link to record page, like this:

HYPERLINK('/'+ Id , Name__c)

The problem is, this has to work inside Salesforce but also in the community, and the problem is that in the community we have a relative url, like this:

www.community.com/something

So the final url using the formula field will be:

www.community.com/123456789

And it needs to be:

www.community.com/something/s/detail/123456789

But if i had the ‘/s/detail’ to the formula field it will stop working on Salesforce side.

Anyone has a solution for this? Using different fields it’s not an option because they access the records in the community using the same listviews.

One Answer

Have you tried using CASE function? you should try somthing like this below.

HyperLink( CASE(LEFT(BASE URL),"your communityurl", 
   "www.community.com/something/s/detail/123456789" 
   LEFT(BASE URL),"https://instance.salesforce.com/", "'/'+ Id , Name__c"))

You can get your base url like below

LEFT($Api.Partner_Server_URL_260, FIND( '/services', $Api.Partner_Server_URL_260))

let me know if this helps.

Answered by Rajesh Banglore on November 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP