You need to sign in to do that
Don't have an account?
Salesforce Admin 110
convert trigger to class
i need to convert this trigger into class methos so i can call from trigger, i have only done this a couple of times so need some help
trigger oppclosedate on Easy_Opportunity__c (before update) { for (easy_opportunity__c opp : trigger.new) if (opp.Stage__c == 'Closed Won' || opp.Stage__c == 'Closed Lost') { opp.Close_Date__c= system.today(); } }
https://developer.salesforce.com/page/Trigger_Frameworks_and_Apex_Trigger_Best_Practices
Change your trigger to look like this...
the triggered records will be passed to the helper class, and as it updates the list that came in - the changes will be committed at the close of the trigger.