Because S4S Cloud Send2CRM allows a Visitor record to be related to more than one parent record, and to be related using custom lookup fields, some additional configuration may be required.
...
By default when a Lead or Contact is deleted and the Visitor is no longer related to any other object, the Visitor record will be deleted. This includes all Visitor-related data such as Sessions and Stats because these use master-detail relationships.
S4S Cloud allows disabling cascade deletion Cascade deletion may be disabled by checking Disable Cascade Delete Visitors in the org-wide custom settings. This will retain Visitor and related records indefinitelyeven when all master objects are deleted.
Cascade delete custom relationships
Lead and Contact relationships are included out-of-the-box with S4S CloudSend2CRM, no additional steps are necessary for these objects.
If you added a custom identification relationship and would like to cascade delete Visitor records, an additional trigger will be required.
Code Block | ||
---|---|---|
| ||
/** * Trigger to cascade delete S4S CloudSend2CRM Visitors. */ trigger CustomObjectCascadeTrigger on CustomObject__c (after delete) { // Cascade delete all related Visitors, whereunless notstill related to other records. // No deletion will occur if cascade delete is disabled by custom setting. FuseIT_S4SCloudsend2crm.VisitorHelper.cascadeDeleteVisitors(Trigger.oldMap.keySet()); } |
Info |
---|
CustomObject__c may be any custom or standard object, for example Case. |
...