You need to sign in to do that
Don't have an account?
Abhishek Purohit
Now here is the question..I need to create an after update.Also trying for an Helper class Kindly guide.
trigger ShippingBillingAddress on Account (before insert,before update,after insert,after update) { if(Trigger.isBefore) { for(Account accountList:Trigger.New) { if(Trigger.isInsert) { accountList.ShippingStreet=accountList.BillingStreet; accountList.ShippingCountry=accountList.BillingCountry; accountList.ShippingCity=accountList.BillingCity; accountList.ShippingState=accountList.BillingState; } if(Trigger.isUpdate) { accountList.ShippingStreet=accountList.BillingStreet; accountList.ShippingCountry=accountList.BillingCountry; accountList.ShippingCity=accountList.BillingCity; accountList.ShippingState=accountList.BillingState; } } } if(Trigger.IsAfter) { List<Contact> contactCreate=new List<Contact>(); for(Account accountList2:Trigger.New) { if(Trigger.IsInsert) { Contact contactrecordCreate=new Contact(); contactrecordCreate.accountId=accountList2.Id; contactrecordCreate.LastName=accountList2.Name; contactrecordCreate.Phone=accountList2.Phone; contactCreate.add(contactrecordCreate); } insert contactCreate; } } }
Done with it...can anyone tell me about it's helper class?
All Answers
1) http://amitsalesforce.blogspot.com/2015/06/trigger-best-practices-sample-trigger.html
Done with it...can anyone tell me about it's helper class?