IF_Trigger.AfterUpdate
Class
apex
global interface IF_Trigger.AfterUpdateKnown Derived Types: TRG_ExecuteValidationRules, TRG_ExecuteValidationRules.afterUpdate(List<SObject>,List<SObject>)
Handler contract for the after-update trigger event.
Methods
| Method | Description |
|---|---|
| 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
| Parameter | Type | Description |
|---|---|---|
newRecords | List | The batch of SObjects with their committed field values. |
oldRecords | SObject | The 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');
}
}
}
}