Obtain DML Operation Information Using Trigger.operationType Context Variable

Use the Trigger.operationType trigger context variable to get context about the current DML operation. Possible values of the System.TriggerOperation enum are: BEFORE_INSERT, BEFORE_UPDATE, BEFORE_DELETE,AFTER_INSERT, AFTER_UPDATE, AFTER_DELETE, and AFTER_UNDELETE.

Where: This change applies to Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.

When: This trigger context variable was introduced in Summer ’18.