Contact Trigger : ================================================ trigger ContactTrigger on Contact ( after insert , after update , after delete , after undelete ) { Set < Id > accountIds = new Set < Id >(); // Insert, Update (new AccountId), Undelete if ( Trigger . isInsert || Trigger . isUpdate || Trigger . isUndelete ) { for ( Contact con : Trigger . new ) { if ( con . AccountId != null ) { accountIds . add ( con . AccountId ); } } } // Delete, Update (old AccountId) if ( Trigger . isDelete || Trigger . isUpdate ) { for ( Contact con : Trigger . old ) { if ( con . AccountId != null ) { ...
Comments
Post a Comment