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
Michael MMichael M 

Best way to create hyperlink

Hello, our Contact object has a lookup to our Lead object. When a Lead is inserted or updated, and certain custom fields are not null, a trigger automatically creates a Contact record. One of those custom Lead fields is a rich text area, because after the Contact is inserted, we want to turn that into a hyperlink which can be clicked on to go straight to the Contact record. What would you advise as the best way to do this? Any help in building the trigger would be greatly appreciated. 
Best Answer chosen by Michael M
Ashish Singh SFDCAshish Singh SFDC
Hi Michael,

As you said, contact has lookup relation with lead, then you can edit your lead page layout and add contact field to the related list. No need for going for a trigger.

But incase you've a requirement to be accomplished using trigger, then you've to create a lookup relation on from lead to contact and update your trigger logic so that it can put ID of contact instead of name.

Best Regards,
Ashish Singh.

All Answers

ShirishaShirisha (Salesforce Developers) 
Hi Michael,

Greetings!

You can place the lookup field of the contact record on the Lead record page layout which will direct you to the contact detailed page whenever you click on the link.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri

 
Ashish Singh SFDCAshish Singh SFDC
Hi Michael,

As you said, contact has lookup relation with lead, then you can edit your lead page layout and add contact field to the related list. No need for going for a trigger.

But incase you've a requirement to be accomplished using trigger, then you've to create a lookup relation on from lead to contact and update your trigger logic so that it can put ID of contact instead of name.

Best Regards,
Ashish Singh.
This was selected as the best answer
Michael MMichael M
Hi Shirisha and Ashish, it can't be a lookup field because the field gets populated automaotically from a feed from an integration. We want to do it without adding a new field...