You need to sign in to do that
Don't have an account?

trigger on opportunity
hi
iam getting the below error please suggest me.
thanks
Error: Compile Error: Invalid bind expression type of SOBJECT:Account for column of type Id at line 5 column 56
trigger score on Opportunity (after insert) {
for(Opportunity op:trigger.new)
{
account acc=[select id,score__c from account where id=:op.Account];
acc.score+=2;
update acc;
}
}
Hi,
Try the below code:
trigger score on Opportunity (after insert)
{
for(Opportunity op:trigger.new)
{
account acc=[select id,score__c from account where id=:op.Accountid];
acc.score__c+=2;
update acc;
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.