-
Notifications
You must be signed in to change notification settings - Fork 6
/
SampleObjectTrigger.cls
83 lines (82 loc) · 4.84 KB
/
SampleObjectTrigger.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**
* ─────────────────────────────────────────────────────────────────────────────────────────────────┐
* Master trigger for the "Sample Object" object (Sample_Object__c).
*
* This trigger provides dispatch logic for the following Trigger Actions:
*
* [Template Note: Delete the Action Handlers that you are not currently implementing.]
*
* BEFORE INSERT
* BEFORE UPDATE
* BEFORE DELETE
* AFTER INSERT
* AFTER UPDATE
* AFTER DELETE
* AFTER UNDELETE
*
* The framework for dispatching additional Trigger Actions has been left in place. To activate
* these additional dispatch calls, un-comment the appropriate lines of code. Before doing so,
* make sure that the corresponding method in the handler class has been implemented.
*
* IMPORTANT! Under no circumstance should additional logic be placed here, within this Trigger
* definition. Trigger logic should ONLY be implemented by the Trigger Handler class, or classes
* called by the Trigger Handler class.
* ──────────────────────────────────────────────────────────────────────────────────────────────────
* @author Vivek M. Chawla <Vivek.M.Chawla@gmail.com>
* @modifiedBy Vivek M. Chawla <Vivek.M.Chawla@gmail.com>
* @maintainedBy Vivek M. Chawla <Vivek.M.Chawla@gmail.com>
* @version 1.0
* @created YYYY-MM-DD
* @modified YYYY-MM-DD
* @systemLayer Invocation
* @see Sample_Object__c.object
* @see SampleObjectTriggerHandler.class
* ──────────────────────────────────────────────────────────────────────────────────────────────────
* vX.X Vivek.M.Chawla@gmail.com
* YYYY-MM-DD Explanation of the change. Multiple lines can be used to explain the change, but
* each line should be indented till left aligned with the previous description text.
*
* vX.X Vivek.M.Chawla@gmail.com
* YYYY-MM-DD Each change to this file should be documented by incrementing the version number,
* and adding a new entry to this @changes list. Note that there is a single blank
* line between each @changes entry.
* ─────────────────────────────────────────────────────────────────────────────────────────────────┘
*/
trigger SampleObjectTrigger on Sample_Object__c (before insert, before update,
before delete, after insert,
after update, after delete,
after undelete) {
//───────────────────────────────────────────────────────────────────────────┐
// Instantiate the Trigger Handler, then dispatch to the correct Action
// Handler Method (eg. BEFORE INSERT or AFTER UPDATE).
//───────────────────────────────────────────────────────────────────────────┘
//SampleObjectTriggerHandler handler = new SampleObjectTriggerHandler();
/* Before Insert */
//if (trigger.isInsert && trigger.isBefore) {
// handler.beforeInsert(trigger.new);
//}
/* Before Update */
//else if (trigger.isUpdate && trigger.isBefore) {
// handler.beforeUpdate(trigger.old, trigger.oldMap, trigger.new, trigger.newMap);
//}
/* Before Delete */
//else if (trigger.isDelete && trigger.isBefore) {
// handler.beforeDelete(trigger.old, trigger.oldMap);
//}
/* After Insert */
//else if (trigger.isInsert && trigger.isAfter) {
// handler.afterInsert(trigger.new, trigger.newMap);
//}
/* After Update */
//else if (trigger.isUpdate && trigger.isAfter) {
// handler.afterUpdate(trigger.old, trigger.oldMap, trigger.new, trigger.newMap);
//}
/* After Delete */
//else if (trigger.isDelete && trigger.isAfter) {
// handler.afterDelete(trigger.old, trigger.oldMap);
//}
/* After Undelete */
//else if (trigger.isUnDelete) {
// handler.afterUndelete(trigger.new);
//}
}