Loading

When an email is logged using Salesforce Email Integration tools, it may appear multiple times on records

게시 일자: Dec 16, 2022
상세 설명
When User uses "Outlook Integration" add-in or "Gmail Integration" chrome extension with/without Inbox enabled, and relate an email to multiple Salesforce Contacts (belonging to the same Account) along with an Opportunity record which is created from the same Contact's Account, User may see that Opportunity and Account shows the same email multiple times on their respective Activity History related list.

Below are some other observations they may see:
  • Each Salesforce Contact (to which email is added) record's  Activity History will only show one email having column value: "Related To = Opportunity Name"
  • Account record's Activity History will contain same emails multiple times having column values: "Name = Contact Name" and "Related To = Opportunity Name"
  • Opportunity record's Activity History will contain same emails multiple times having column values: "Name = Contact Name"
솔루션
The first behavior is observed when you have below settings in your Salesforce organization, under Setup | Activities | Activity Settings:
  • Roll up activities to a contact's primary account is ENABLED (When an activity is associated to a contact, also display the activity under the primary account for the contact.)
  • Allow Users to Relate Multiple Contacts to Tasks and Events is DISABLED

This happens when the Shared Activities feature is not enabled in an organization.  Shared Activities allows an event or task to be related to up to 50 Contacts, thus creating a single Email record in Salesforce instead of creating multiple email records for each Contact.

Please review the following articles before enabling shared activities in your organization:

Enable Shared Activities
Considerations for Enabling Shared Activities (Multiple Contacts on an Activity)

The second behaviour is noticed, when Salesforce organization has other Customization (Trigger, Process Builder, Flow, etc.) written on 'Task' object, as part of Business Use Case, which potentially prevents Task deletion.

Depending on "Allow Users to Relate Multiple Contacts to Tasks and Events" is Enabled or Disabled, Salesforce standard logic involves insertion of two or more Task records, when an Email is logged to WhoID ('Name' field i.e. Contact) and WhatID ('Related To' field i.e. Account, Opportunity, Order, Contracts, Campaigns, Custom Object, etc.). One Task is created for WhoID and other Task record is created for WhatID associated with same email, and later Salesforce deletes one Task record, keeping only single Task which shows both WhoID ('Name' field) and WhatID ('Related To' field) populated with the value to which email was logged.

If you use Workbench/Dataloader or other backend tool to validate it, you will notice a Task record with same details being shown with 'IsDeleted = true' having blank 'WhatId' and 'WhoId' values.

SOQL Query: SELECT Id,IsDeleted,Status,Subject,TaskSubtype,WhatId,WhoId FROM Task WHERE Subject LIKE '%Email: Your Email Subject%'


NOTE: The 'Subject' field for tasks created from an EmailMessage always begins with the prefix "Email:" and the 'TaskSubType' is always "Email". Thus, modify the custom code to exclude such tasks having these field values to avoid any unwanted/unexpected behaviour.
 
Knowledge 기사 번호

000384862

 
로드 중
Salesforce Help | Article