I'm trying to add a detail link to an HTML Email template, to link to a related record on the object being merged into the e-mail.

I am aware of the process for adding a link/detail link for the object in the template by using


But my Communication object has a lookup to a Case called ParentId__c (which I can be sure is not null..) and I want to link to THIS object... my initial thought was to use


and it would traverse the relationship, and then merge out the Link value as with other objects, but this has not worked.

I'd rather not "build" the URL using "company URL" etc. and I'd like to avoid adding more custom fields to the object, but if these sorts of ideas are our only option...so be it.

2 Answers 2


From what I remember standard emails (= non-Visualforce ones) will give you hard time when you want to use more than one dot to go "up".

I'm aware of only 2 workarounds you have mentioned:

  • a helper formula field (type = URL maybe? so it's at least a bit reusable); I've created "Case Contact's Phone" etc that way in the past
  • craft the URL by hand using the trick described in Detail page link under email template
  • Yep. It was the @BobBuzzard post that we used in the end. A formula field on the object with the "left" function and the servlet URL. not an ideal approach, but solid and functional! Apr 17, 2014 at 20:05

i used Classic email template - custom template:

<a href="{!Left(Opportunity.Link,find('.com',Opportunity.Link)))}com/{!Opportunity.ContractId}">{!Opportunity.Contract}</a>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .