Slaesforce Triggers
What is Apex Triggers ? A Trigger is Apex code that executes before or after the following types of operations: insert update delete merge upsert undelete Types of Apex Triggers Before Triggers: Before triggers can be used to update or validate record values before they are saved to the database. After Triggers: After triggers can be used to access field values that are set by the database (such as a record's Id or last Updated field), and to affect changes in other records, such as logging into an audit table or firing asynchronous events with a queue. Example : before insert, after insert, before update, after update, before delete, after delete Syntax of Trigger Important Points- Bulkify your Code : Use Looping through Trigger’s collections variables instead of process through particular indexing. All triggers are bulk triggers by default, and can process multiple records at a time. Bulk triggers can handle both single record updates and bulk ...