You need to sign in to do that
Don't have an account?
Merge field error in HTML email template
I'm new to Visualforce and trying to make a Visualforce email template. I'm trying to make an email template that list some information about the Pricing Request (Parent Object), but also lists all of the Price Adjustments (Child Object) within it. All of the HTML is correct, but I'm having big problems with merge fields within it. I put the same merge fields that are in the regular email templates, but keep getting errors with them,
error message reads " Error: Invalid field Price_Adjustment__c for SObject Pricing_Request__c"
This is the part of the code that is supposed to put the data into the table
<apex:repeat var="pa" value="{!relatedTo.Price_Adjustment__c}">
<tr>
<td>{!pa.Product__c}</td>
<td>{!pa.Brand_Group__c}</td>
<td>{!pa.Brand__c}</td>
<td>{!pa.Flavour__c}</td>
<td>{!pa.Format__c}</td>
<td>{!pa.Size__c}</td>
<td>{!pa.Pack__c}</td>
<td>{!pa.Rebate__c}</td>
</tr>
</apex:repeat>
Any idea why I'm getting that message?
Thank you,
Adam
You are trying to access the values of Price Adjustments(Child) from the Pricing Request(Parent). Two ways of accessing your Parent record related to the Child record are
1. Ensure that your email template is based on the Child object and try accessing the related parent object.
2. If you are using VF email template, try to use Custom Controllers to display the related records.
With Regards,
Sgt_Killer