You need to sign in to do that
Don't have an account?
Simple Apex Trigger - unexpected token???
Hi -
I am writing a basic apex trigger to update a quote revision number. I need to select the max version number within a quote, within an opportunity.
I get an unexpected token on the red line below. The revision? field is a custom checkbox field in the quote table.
Thanks for your help!!!
trigger quoteversioning on Quote (before insert) {
for (quote insertedquote : system.Trigger.new)
{
if (insertedquote.revision?)
{ quote QT = [select max(version__c) from quote
where quotenumber = :insertedquote.quotenumber
and opportunity = :insertedquote.opportunity];
insertedquote.version__C = QT.version__c + 1;
}
}
}
Since 'revision?' is custom field , please refer its API name, it should be appended with '__c' at end.
All Answers
Since 'revision?' is custom field , please refer its API name, it should be appended with '__c' at end.
Thanks! That was a complete oversight.
Now it is telling me that opportunity is not a field in the quote table....hmmmm....I see it there?!
Would you happen to know how to find the correct opportunity from within a quote trigger?
Thanks again!!