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
hello vivek,
see below sample example for your requirement. Apex Trigger:
trigger trgInsertInvoice on Opportunity (after update) { List<Invoice__c> lstInvoice = new List<Invoice__c>(); Invoice__c objInvoice; for(Opportunity opp: trigger.new){ if(opp.StageName == 'Closed Won' && trigger.oldmap.get(opp.id).StageName != 'Closed Won'){ objInvoice = new Invoice__c(); objInvoice.Name = 'Test Invoice'; objInvoice.Opportunity__c = opp.id; lstInvoice.add(objInvoice); } } if(lstInvoice.size() > 0){ insert lstInvoice; } }
Thank You, Hitesh Patel SFDC Certified Developer & Administrator & Advanced Administrator & Sales cloud consultant Email :- hiteshpatel.aspl@gmail.com My Blog:- http://mrjavascript.blogspot.in/
hello vivek,
see below sample example for your requirement.
Apex Trigger:
Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator & Advanced Administrator & Sales cloud consultant
Email :- hiteshpatel.aspl@gmail.com
My Blog:- http://mrjavascript.blogspot.in/