Saturday, August 20, 2016

Trigger Context Variables


  1. isExecuting--Returns true if the current context for the Apex code is a trigger, not a Visualforce page, a Web service, or an executeanonymous() API call.
  2. isInsert
  3. isUpdate
  4. isDelete
  5. isUndelete--Returns true if this trigger was fired after a record is recovered from the Recycle Bin (that is, after an undelete operation from the Salesforce user interface, Apex, or the API.)
  6. isBefore--Returns true if this trigger was fired before any record was saved.
  7. isAfter--Returns true if this trigger was fired after all records were saved
  8. new--Returns a list of the new versions of the sObject records.Note that this sObject list is only available in insert and update triggers, and the records can only be modified in before triggers.
  9. old--Returns a list of the old versions of the sObject records.
    Note that this sObject list is only available in update and delete triggers.
  10. newMap--A map of IDs to the new versions of the sObject records.
    Note that this map is only available in after insert, and update triggers.
  11. oldMap--A map of IDs to the old versions of the sObject records.Note that this map is only available in update and delete triggers.
  12. size--The total number of records in a trigger invocation, both old and new.
  13.  Table for defining contaxt variable values "NULL" or "NOT  NULL" 
  14. TCV*
    Before Insert
    After Insert
    Before Update
    After Update
    Before Delete
    After Delete
    After Undelete
    New
    NOT NULL,
    MODIFIABLE
    NOT NULL
    NOT NULL
    NOT NULL
    NULL
    NULL
    NOT NULL
    Old
    NULL
    NULL
    NOT NULL
    NOT NULL
    NOT NULL
    NOT NULL
    NULL
    newMap
    NULL
    NOT NULL
    NOT NULL
    NOT NULL
    NULL
    NULL
    NOT NULL
    oldMap
    NULL
    NULL
    NOT NULL
    NOT NULL
    NOT NULL
    NOT NULL
     NULL
*TCV->Trigger Context Variable





No comments:

Post a Comment

Thanks for your comment