+ Start a Discussion
sftechlearnersftechlearner 

Inserting link of a look up field in an email template.

Hi,

 

I have an email  template that merges all the fields in opportunity. In the opportunity page we have look up for Case.

I would like to merge the link for this look up field case in the email template.

 

Any idea on this?

 

Thank you!!!

Vinita_SFDCVinita_SFDC

Hello,

 

As of now cross object merge field in email template doesn't work. It seems that you can use cross object merge fields in an email template, because they are exposed as merge field values, it does not work. Please allow the ability to use cross objects merge fields in email templates.

 

Right now the only workaround is to use hidden formula fields on the parent object to copy the child object fields there and then build the template using those hidden formula fields. The disadvantage to this is that you are using up your custom field quota just to create an email template.

 

I would suggest you to promote the idea on idea exchange at below link:

https://success.salesforce.com/ideaView?id=08730000000Brk7AAC

 

spielsspiels
You now have a new option to make this work! You can read more about how to merge cross object fields into Salesforce email templates here (http://www.contactmonkey.com/blog/cross-object-fields-in-salesforce-email-templates-fixed). You can even merge the templates into Outlook.

Hope this helps!
Tom EllisTom Ellis
I have been searching all the replies to similar queries in the hope of a good solution - turns out a lot of people have needed this for a long time! I took the work-around approach suggested by Vinita above and used a hidden formula field to construct a URL from the child record ID (In sftechlearner's original post above that would be the ID field for the Case object) I then used a formula to construct the URL with the ID inserted and it works like a charm. Sure, it uses up another custom field but I'm nowhere near the limit so whilst we are still using Classic Email Templates this will have to do for now.
You will need a formula field of text type with a formula similar to this...
"https://mydomain.lightning.force.com/lightning/r/Case__c/" & Case__r.Id & "/view/"
Remember to replace <mydomain> in the URL for your own company if you use one and <Case__c> and <Case__r> for whatever the name of the child object is in your own scenario. Hover over the actual lookup field link to see what the URL is and then copy it but replace the ID part with the related object ID field. In my own case, the ID field returned 15 character ID's whereas the lookup field on the parent object uses the 18 character link but it makes no difference as they are both interchangeable (and it saves a few bytes on your formula field limits).
Hope this helps people.