To reference the old value of a field in a trigger, use the following syntax:
Trigger.oldMap.get(account.Id).fieldName
So to ensure a field was changed during an update trigger you will have:
Trigger.oldMap.get(account.Id).fieldName
So to ensure a field was changed during an update trigger you will have:
if (Trigger.isUpdate) { if (account.fieldname != Trigger.oldMap.get(account.Id).fieldName) { // Field has been changed! } }
No comments :
Post a Comment