Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

How to create a hyperlink formula salesforce field which when clicked should redirect to a specified record page?

Asked by Darsh K Jun 5, 2024 6.7K views 3 answers
Share

About this question

 There are 2 custom objects linked to each other via lookup. The requirement is to create a hyperlink formula field in the child record which when clicked should direct to the parent record page.Is this requirement possible via hyperlink formula field?

Your answer

3 Answers

Ranjana Admin JanBask Expert Latest answer

Answered on Feb 3, 2025

In Salesforce, you can create a Hyperlink Formula Field that redirects users to a specific record page when clicked. Here's how you can do it:

Steps to Create a Hyperlink Formula Field

1. Go to Object Manager

Navigate to Setup → Object Manager.

Select the object where you want to add the hyperlink.

2. Create a New Formula Field

Click on Fields & Relationships → New.

Select Formula as the data type.

Choose Text as the return type.

Write the Formula

Use the HYPERLINK function to generate the clickable link:

  HYPERLINK('/' & Id, Name, '_self')

  • / + Id → Creates a relative link to the record page.
  • Name → The text displayed as the hyperlink.
  • '_self' → Opens the link in the same window.

Alternative: Full URL Format

If users access Salesforce in Lightning Experience, use a complete URL:

  HYPERLINK('https://yourDomainName.lightning.force.com/' & Id, Name, '_blank')

  • Replace "yourDomainName" with your actual Salesforce domain.
  • '_blank' opens the link in a new tab.

Best Practices

✔ Use relative URLs (/' & Id) for compatibility with both Classic and Lightning.

✔ Ensure users have proper permissions to access the record.

✔ If linking to a related object, replace Id with the related record's lookup field (RelatedObject__r.Id).

Let me know if you need further refinements!

Was this helpful?

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.