Achieve your business goals faster by unlocking our Salesforce Cloud Services.
5. isInsert: Returns true if the trigger was fired due to an insert operation.
6. isUpdate: Returns true if the trigger was fired due to an update operation.
7. isDelete: Returns true if the trigger was fired due to a delete operation.
8. isUndelete: Returns true if the trigger is fired after a record is recovered from recycle bin.
9. isBefore: Returns true if the trigger was fired before any record was saved.
10. isAfter: Returns true if the trigger was fired after all records were saved.
11. Size: Returns the total number of records in a trigger invocation, both old and new.
trigger ApexTrigger on Contact (before insert, before update, before delete, after insert, after update, after delete) {
// 5) isInsert
// 6) isUpdate
// 7) isDelete
// 8) isUndelete
// 9) isBefore
//10) isAfter
//11) Size
if(trigger.isBefore)
{
if(trigger.isInsert)
System.debug(‘I am before Insert’);
} else if(trigger.isUpdate)
System.debug(‘I am before Update’);
} else if(trigger.isDelete)
System.debug(‘I am before Delete’);
}
} else if(trigger.isAfter)
System.debug(‘I am after Insert’);
System.debug(‘I am after Update’);
System.debug(‘I am after Delete’);
} else if(trigger.isUndelete)
System.debug(‘I am after Undelete’);
< < Previous
Next > >
The batch is going to start shortly. Fill the form given below to Register yourself now.
Fill the form below to get a Result
Fill the form below to get a demo of this course.
Online Salesforce Development Course is soon going to be launched. Please fill the form and we will notify you about the course.