Skip to content

IF_Trigger.AfterUpdate ​

Class

apex
global interface IF_Trigger.AfterUpdate

Known Derived Types: TRG_ExecuteValidationRules, TRG_ExecuteValidationRules.afterUpdate(List<SObject>,List<SObject>)

Handler contract for the after-update trigger event.


Methods ​

MethodDescription
global abstract void afterUpdate(List<SObject> newRecords, List<SObject> oldRecords)Called after records have been updated and committed, enabling cascading updates to related objects, notifications, or audit trail entries.

afterUpdate ​

apex
global abstract void afterUpdate(List<SObject> newRecords, List<SObject> oldRecords)

Called after records have been updated and committed, enabling cascading updates to related objects, notifications, or audit trail entries.

Parameters

ParameterTypeDescription
newRecordsListThe batch of SObjects with their committed field values.
oldRecordsSObjectThe batch of SObjects with their values prior to the update.

Example

apex
public class TRG_SyncAccountToExternal extends TRG_Base implements IF_Trigger.AfterUpdate
{
    public void afterUpdate(List<SObject> newRecords, List<SObject> oldRecords)
    {
        for(Integer i = 0; i < newRecords.size(); i++)
        {
            if(newRecords[i].get('Name') != oldRecords[i].get('Name'))
            {
                LOG_Builder.build().info('Name changed').emitAt('TRG_SyncAccountToExternal');
            }
        }
    }
}