4 个回答

Hi Chaitra,A trigger is the piece of code that executed before and after a record is Inserted/Updated/Deleted from the force.com database.Before Trigger: Before triggers are used to perform the logic on the same object and specifically we cannot use the DML operation (Insert, update, delete) on these triggers. These triggers fired before the data saved into the database.After Trigger: After triggers are used to perform the logic on the related objects and these triggers are used access the fields values that are created by system (Ex: CreatedBy, LasteModifiedBy , Record Id etc..).For more information please refer to these links:https://www.salesforcetutorial.com/apex-trigger-in-salesforce/ http://sfdcinpractice.com/index.php/2017/01/09/3-6-difference-trigger/I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.Thanks and Regards,Deepali Kulshrestha