I have a child object to Case. That child object has a formula field that automatically gets populated with the account associated with Case. I want it to be a hyperlink. So it should show Account's name, and clicking on it should take a user to account.
One option is to make it a lookup field and use before insert trigger to automatically populate it.
But i want to do it via formula field. Where it automatically looks up the Account from the parent case .... the text displays the account name and it is a hyper link to account. Any suggestions would be helpful.
I know in the formulae field we can put HYPERLINK(link, displaytext, 'Self')
link and display text can be generated using some logic that goes like this - String link = URL.getSalesforceBaseUrl().toExternalForm() +'/'+Case__r.AccountID String displaytext = Case__r.Account.Name
Somehow i am unable to put it all together in a single formula that gives me desired result.