Trigger Opp_trigger on Opportunity (Before Insert, Before Update) { for(Opportunity a :Trigger.New ) { if(a.Amount < 5000) a.addError('amount can not be greater than 5000'); }
Trigger Opp_trigger on Opportunity (Before Insert, Before Update) { for(Opportunity a :Trigger.New ) { if(a.Amount < 5000) a.addError('amount can not be greater than 5000'); }
Delete this trigger and recreate like below .. looks like if you created on the opportunity line item and trying to change to opportunityy
Use this code
Trigger Opp_trigger on Opportunity (Before Insert, Before Update) {
for(Opportunity a :Trigger.New )
{
if(a.Amount < 5000)
a.addError('amount can not be greater than 5000');
}
}
for(Opportunity a :Trigger.New )
{
if(a.Amount < 5000)
a.addError('amount can not be greater than 5000');
}
}
I have written like this..what is the error here
All Answers
can you give me a code
for(Opportunity a :Trigger.New )
{
if(a.Amount < 5000)
a.addError('amount can not be greater than 5000');
}
}
I have written like this..what is the error here
Use this code