function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger OpportunityTrigger on Opportunity (before insert,Before Update) { if(trigger.IsBefore After && trigger.IsInsert){ for(Opportunity oOpp :Trigger.New){ if(oOpp.StageName == 'Closed Won' && Price__c == null){ oOpp.AddError('OppoTUnity Cannot Be Closed if Proce Is Not Set'); } } }else if(trigger.IsBefore&& trigger.IsUpdate){ for(Opportunity oOpp :Trigger.New){ if(oOpp.StageName == 'Closed Won' && Price__c == null && oOpp.StageName!= trigger.OldMap.get(oOpp.Id).StageName){ oOpp.AddError('OppoTUnity Cannot Be Closed if Proce Is Not Set'); } } } }
Try Below Trigger Please Mark It As Best Asnwer If It Helps
Thank You!