Because S4S Cloud 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.
Disable cascade delete
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 by checking Disable Cascade Delete Visitors in the org-wide custom settings. This will retain Visitor and related records indefinitely.
Cascade delete custom relationships
Lead and Contact relationships are included out-of-the-box with S4S Cloud, 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.
/** * Trigger to cascade delete S4S Cloud Visitors. */ trigger CustomObjectCascadeTrigger on CustomObject__c (after delete) { // Cascade delete all related Visitors, unless still related to other records. // No deletion will occur if cascade delete is disabled by custom setting. FuseIT_S4SCloud.VisitorHelper.cascadeDeleteVisitors(Trigger.oldMap.keySet()); }
CustomObject__c may be any custom standard object, for example Case.