You need to sign in to do that
Don't have an account?
Zabi noor
Don't allow to modify the Opportunity object when stage is Closed WonWith this apex trigger i'm not to modify the record if the stage is equal to Closed Won, but when record is not closed won. Not able to change stage to closed won also.
With this apex trigger i'm not to modify the record if the stage is equal to Closed Won, but when record is not closed won. Not able to change stage to closed won also.
trigger OpportunityTrigger on Opportunity(before update, before delete){
for(Opportunity opp1: Trigger.new) {
if(opp1.StageName == 'Closed Won'){
opp1.addError('You cannot modified the opportunity when stage is Closed Won.');
}
}
trigger OpportunityTrigger on Opportunity(before update, before delete){
for(Opportunity opp1: Trigger.new) {
if(opp1.StageName == 'Closed Won'){
opp1.addError('You cannot modified the opportunity when stage is Closed Won.');
}
}
I think you may be looking something like this
Let me know if this helped