Find your content:

Search form

You are here

Apex can be invoked through the use of triggers. A trigger is Apex code that executes before or after the following types of operations: insert

 
Share

Apex can be invoked through the use of triggers. A trigger is Apex code that executes before or after the following types of operations:

  • insert
  • update
  • delete
  • undelete (after only)

For example, you can have a trigger run before an object's records are inserted into the database, after records have been deleted, or even after a record is restored from the Recycle Bin.

You can define triggers for any top-level standard object, such as a Contact or an Account, but not for standard child objects, such as a ContactRole.

  • For case comments, click Your Name | Setup | Customize | Cases | Case Comments | Triggers.
  • For email messages, click Your Name | Setup | Customize | Cases | Email Messages | Triggers.

Triggers can be divided into two types: - Before triggers can be used to update or validate record values before they are saved to the database. - After triggers can be used to access field values that are set by the database (such as a record's Id or lastUpdated field), and to affect changes in other records, such as logging into an audit table or firing asynchronous events with a queue.

Useful Documentation


Attribution to: Saariko
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/781

My Block Status

My Block Content