Tuesday 12 March 2013

Trigger Context Variables


DescriptionExample
isAfterReturns true if this trigger was fired after all records were saved.

isBeforeReturns true if this trigger was fired before any record was saved.

isDeleteReturns true if this trigger was fired due to a delete operation.

isExecutingReturns true if the current context for the Apex code is a trigger only.

isInsertReturns true if this trigger was fired due to an insert operation.

isUndeleteReturns true if this trigger was fired after a record is recovered from the Recycle Bin.

isUpdateReturns true if this trigger was fired due to an update operation.

newReturns a list of the new versions of the sObject records. (Only in insert and update triggers, and the records can only be modified in before triggers.)

newMapA map of IDs to the new versions of the sObject records. (Only available in before update, after insert, and after update triggers.)

oldReturns a list of the old versions of the sObject records. (Only available in update and delete triggers.)

oldMapA map of IDs to the old versions of the sObject records. (Only available in update and delete triggers.)

sizeThe total number of records in a trigger invocation, both old and new.

Categories: ,

0 comments:

Post a Comment

    Links