Activity Data
The following Apex classes are used to create a record of the custom Activity object (Activity__c) and a related record of the custom ActivityData object (ActivityData__c):
-
ActivityProcessHandler
-
GlobalActivityService
The following trigger invokes the Apex classes:
-
ActivityProcess
| Before implementing, the system checks that the ActivityProcess trigger is specified in the custom Trigger Settings. |
A trigger is invoked by operations on the recurring events.
The following trigger methods of the ActivityProcessHandler class are implemented:
-
onBeforeInsert
-
onBeforeUpdate
-
onBeforeDelete
-
onAfterInsert
-
onAfterUpdate
-
onAfterDelete
In the Setup → Custom Code → Custom Settings → Trigger Settings, the system checks methods in the Bypass Logic field of the ActivityProcess trigger.
| ActivityProcessHandler Method | Execution |
|---|---|
onBeforeInsert |
Create a record of the custom Activity object related to the Contact and Account objects, assign the related Marketing Cycle, set Target Frequency, and add Objectives. |
onBeforeUpdate |
Assign the related Marketing Cycle, set Target Frequency, and add Objectives to the record of the custom Activity object. |
onBeforeDelete |
Search and delete the records of the standard Event and Task objects related to removed records of the custom Activity object. |
onAfterInsert |
Create data of the record of the custom Activity Data object, which is related to the record of the custom Activity object. Calculate finished activities and fill in the Actual Calls field of the record of the Target Frequency object. According to the settings, add Objectives and grant access to the record of the Joint Visit for relevant users. According to the Activity Sync, create records of the standard Event and Task objects. |
onAfterUpdate |
Update data of the record of the custom Activity Data object, which is related to the record of the custom Activity object. Recalculate finished activities and fill in the Actual Calls field of the record of the Target Frequency object. According to the value in the Next Call Date field and Next Call Settings, create children records of the custom Activity object. According to the settings, grant access to the record of the Joint Visit for relevant users. |
onAfterDelete |
After removing related records of the custom Activity object, recalculate the finished activities in the Actual Calls field of the record of the Target Frequency object. |