You need to sign in to do that
Don't have an account?
babloo123
Email Template Type VisualForce
Need to create a visual force email template on a custom Object to view fields (merge fields on that object) can some one guide how?
if any example some one has?
if any example some one has?
I am trying on custom object and I need two merge fields on it
1. Lookup of contact name on the Custom Object
2. Detailed Link of that record
when I try related to Lookup of contact name I am getting 18 digit id instead of name can you guide me how to get those both?
For Detailed Link of that record, you can use the following work around
<apex:variable var="url" value="{!LEFT($Api.Partner_Server_URL_140, FIND(".com/",$Api.Partner_Server_URL_140)+3)}"/>
Link to <apex:outputLink value="{!url}/{!relatedTo.Id}">Record</apex:outputLink>
or you can use
https://<your-instance>.salesforce.com/{!relatedTo.id}
The Link one is working fine but the Contact is not working. The Contact name on our object is Reviewer_Name__c but it is not working and if I use related to and reviewer Name then it is giving 18 digit Id other than name can you please guide me there
{!<custom_object__c>.Reviewer_Name__r.firstName} {!<custom_object__c>.Reviewer_Name__r.lastName}
<messaging:emailTemplate subject="PCORI: Reviewer Unclear About COI Status" recipientType="Contact" relatedToType="COI_Expertise__c">
<messaging:htmlEmailBody >
<html>
<body>
Reviewer Name: {!<COI_Expertise__c>.Reviewer_Name__r}
https://cs30.salesforce.com/{!relatedTo.id}
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
I am trying above code but now it says error below
Error: Syntax error. Found '<'
If I remove < then also not working throwing below error
Error: Unknown property 'core.email.template.EmailTemplateComponentController.COI_Expertise__c'
Reviewer Name: {!COI_Expertise__c.Reviewer_Name__r.firstName} {!COI_Expertise__c.Reviewer_Name__r.lastName}
Error: Unknown property 'core.email.template.EmailTemplateComponentController.COI_Expertise__c'
Reviewer Name: {!relatedTo.Reviewer_Name__r.firstName} {!relatedTo.Reviewer_Name__r.lastName}
you mean the below line is not working?
https://cs30.salesforce.com/{!relatedTo.id}
there is no issue with the code above. preview the email template by selecting the contact and an COI_Expertise__c record. you should see the id populated.