Skip to content

Two deleted tasks appear in Salesforce after EmailMessage sync

Issue

When an EmailMessage is saved to Salesforce via Revenue Grid synchronization, two tasks with the same names appear in Salesforce’s Recycle Bin:

Deleted tasks in Recycle Bin

The deletion times of these tasks correspond to the time the EmailMessage was created by the sync.

Deleted tasks creation time

Explanation

This behavior is part of the standard workflow during the creation of an EmailMessage in Salesforce. Here’s how the process works:

  1. Creating a draft EmailMessage: When an EmailMessage is created with draft status, Salesforce automatically generates a task related to it. This task is then deleted in the next step.
  2. Adding relations to the EmailMessage: When a relation is added to the draft EmailMessage, another task is generated and deleted shortly after.
  3. Changing the EmailMessage status to read: When the EmailMessage status is updated to “read”, a final task is created, and the previous two tasks remain deleted in the Recycle Bin.

This process occurs due to how Salesforce handles email messages created via the API, resulting in two additional tasks being created and then deleted during the synchronization.



Back to top