You need to sign in to do that
Don't have an account?
Error: Invalid field Opportunity_Rebate__r for SObject Opportunity
I am writing a simple VF template
Getting an error while saving ( Error: Invalid field Opportunity_Rebate__r for SObject Opportunity)
Opportunity_Rebate is a custom related list and Master Detail with the Opportunity
i have tried all the options(Opportunity_Rebate__c ,Opportunity_Rebates__c,Opportunity_Rebates__r,Opportunity_Rebate__r)
<messaging:emailTemplate subject="testing"
recipientType="Contact"
relatedToType="Opportunity"
subject="Rebates for opportunities: {!relatedTo.name}">
<messaginglainTextEmailBody >
Dear {!recipient.name},
Below is a list of Opportunities Rebates related to Opportunity: {!relatedTo.name}
[ Discount ] - [ Subject ] - [ Email ] - [ Status ]
<apex:repeat var="cx" value="{!relatedTo.Opportunity__Rebate__r}">
[ {!cx.Discount__c} ]
</apex:repeat>
</messaginglainTextEmailBody>
</messaging:emailTemplate>
Any suggetions!!Do i need to add somting else
Thnaks
On your Opportunity Rebate custom object click on the master detail field to the Opportunity and check the child relationship name. This is what you should be using (followed by __r) to get the records from a visualforce page.
If you're doing that already then I assume visualforce templates don't allow access to child records...
All Answers
On your Opportunity Rebate custom object click on the master detail field to the Opportunity and check the child relationship name. This is what you should be using (followed by __r) to get the records from a visualforce page.
If you're doing that already then I assume visualforce templates don't allow access to child records...
It worked :) , Actually i havnt defined any Child relationship name ;), after defining the relationship name to OpportunityRebates and using the OpportunityRebates__r worked
Thanks :)