Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

CDP4S supports relating a Sitecore CDP Guest to a Lead or Contact out of the box. Simply set the Master Lookup Field setting to use the ‘Lead‘FuseIT_CDP4S__Lead__c’ or ‘Contact‘FuseIT_CDP4S__Contact__c’ field on the Sitecore_CDP_Guest__c object.

...

Code Block
/**
 * Perform required Personalization and Analytics from associated Opportunity changes.
 */
trigger CDP4SOpportunityTrigger on Opportunity (before delete, after insert, after update) {
  if (trigger.isDelete && Trigger.oldMap != null) {
    // Delete related Guest data if settings allow.
    FuseIT_CDP4S.GuestHelper.DeleteGuestsIfCascadeEnabled(Trigger.oldMap.keySet());
  }
  else {
    // Update Sitecore CDP with mapped data when it changes on an Opportunity.
    FuseIT_CDP4S.PersonalizationHelper.UpdatePersonalizationFromTrigger(trigger.new, Trigger.oldMap);
  }
}