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 opptyTrigger on Opportunity (after update) { list<Opportunity> lstopp = new list<Opportunity>(); for(opportunity opp : trigger.new){ if(opp.StageName == 'Closed Won' && Opp.StageName != trigger.oldMap.get(Opp.Id).StageName && Opp.AccountId != Null){ Opportunity opp1 = new Opportunity(); opp1.Name = opp.Name + 'new'; opp1.AccountId = opp.AccountId; opp1.CloseDate = opp.CloseDate.addDays(120); opp1.StageName = 'Prospecting'; lstopp.add(opp1); } } if(lstOpp.size()>0){ insert lstOpp; } }
Try Below Trigger Please Mark It As Best Answer If It Helps
Thank You!
All Answers
Try Below Trigger Please Mark It As Best Answer If It Helps
Thank You!
Could you please provide Test class for that Triiger.It will be helpfull.