You need to sign in to do that
Don't have an account?
Sammy7
invalid relationship key in opportunity
I want to create an invoice so when my opportunity is closedwon and my custom field QuotetoInvoice on Quote object (is checked) is true
But Im having problem with the conditinal statement.... it says "Invalid foreign key relationship: Opporutnity.quote__r "
for(Opportunity o : trigger.new)
{
if (o.stagename=='Closed Won'&& o.quote__r.QuotetoInvoice__c== TRUE))
{
oppIdSet.add(o.id);
}
}
Please guide me.
But Im having problem with the conditinal statement.... it says "Invalid foreign key relationship: Opporutnity.quote__r "
for(Opportunity o : trigger.new)
{
if (o.stagename=='Closed Won'&& o.quote__r.QuotetoInvoice__c== TRUE))
{
oppIdSet.add(o.id);
}
}
Please guide me.
So, if you don't have any custom relationship then you have to query thr Quotes object using the opportunity id and then check if the QuotetoInvoice__c is true.
All Answers
So, if you don't have any custom relationship then you have to query thr Quotes object using the opportunity id and then check if the QuotetoInvoice__c is true.