function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Need help with a Hyperlink formula

I have a custom formula field (text)


Formula is: HYPERLINK("/"& WhatId, "Detail Link")


It appears as this clickable link which takes you to the account detail page.

Detail Link


Does anyone know if and how I can update the formula so that instead of the static name "Detail Link", it can dynamically update to the Account Name value?


Best Answer chosen by Admin (Salesforce Developers) 

HYPERLINK("/"& WhatId,  Account.Name)

All Answers

Steve :-/Steve :-/
Could you provide a little more information about the object that the hyperlink field is on, and the relationship that it has with the Account object?

This field is a custom field on the task object and it was created to show the account name when the related to field is the campaign.




Good Morning,


I did something similar to what I think you are asking for using Formula Fields, and my formulas are below. 


We have a custom object, NSR or New Service Request, that is linked to an Opportunity.  I use the linked Opportunity to get to the Account, but in your case, you might be able to get there by linking through the Task's Contact's Account.  I would just see what connections you can find using the "Insert Field" button.  


I created, but don't use, the formula field that displays the hyperlinked Account.  In production, I do use one that displays and hyperlinks to the Contact that requested the opportunity.  


This is the formula for Account:

HYPERLINK( "" & Opportunity__r.Account.Id, Opportunity__r.Account.Name, "_self")


I created a similar formula for Contact, aka "Requested By":

HYPERLINK( "" & Opportunity__r.Request_By__r.Id , Opportunity__r.Request_By__r.FirstName & " " & Opportunity__r.Request_By__r.LastName , "_self")



The https should be whatever the leading information is on your Sales Force, so it might be a little different than mine.  


Best of Luck,




Message Edited by Mandy_in_MN on 09-14-2009 10:20 AM



It doesn't quite work because the Account name is a hidden lookup here. Thanks though, i appreciate it.


What do you mean by 'hidden' is it hidden due to field level security or just not on the page layout?

If it is due to field level security it does not seem like you would be able to do it, however if it is just not on the layout then you should be able to.

Let me know if you have any questions.

This has been solved. Thanks for your comments.

Hi Spunky:

Could you share what solved your problem (or mark the post as a Solution) so that those of us who are curious, or facing similar issues can benefit?



I have tried to post this solution however it's on a different message board.

Thanks for providing the link...  (Although it's usually good not to cross post.) But, thanks.

HYPERLINK("/"& WhatId,  Account.Name)

This was selected as the best answer
thanks. that works

I need a hyperlink formula to place in the error message box. 


The link should go to:


Any suggestions or ideas of this will even work from the validation rule error message box?






If you are trying to get the error message to appear as an interactive hyperlink, I don't think that can be done.

The hyperlink will appear, but as a static field.

Maybe someone else has a solution though



Its not possible, I just found my answer in the Help settings within salesforce. Hyperlinks are not possible to do in Validation Rules.


Maybe someone should suggest this in the idea exchange.


Thanks for checking anyway!

Chetan Kamble 1Chetan Kamble 1
This is very simple you need the 2 fields one which holds the Id of the record and second formula with hyperlink which will hold the name you want to display as link.
HYPERLINK("/"& RecordId__c,  Account.Name) In this the RecordId__c has the id of the account. And Account.Name has the name which you want to display on detail page. Use HYPERLINK("/"& RecordId__c,  Account.Name) this value as formula in formula field.