"Lead Was Deleted from SFDC" removed a person that was DEFINITELY in Salesforce. What's up with that? | Community
Skip to main content
Aaron_Dear
Level 3
February 14, 2018
Solved

"Lead Was Deleted from SFDC" removed a person that was DEFINITELY in Salesforce. What's up with that?

  • February 14, 2018
  • 2 replies
  • 10402 views

Hey all - weird question. This is the first time I've had this problem.

I ran a batch campaign yesterday (Feb 13):

  • Smartlist: Lead Was Deleted from SFDC within the past 120 days.
  • Flow: Delete Person - Remove from CRM = TRUE

I got a slack message this morning (Feb 14) asking about where a contact had gone. She had a name and email address. I know I ran that batch campaign, so I checked the Salesforce Recycle Bin. Sure enough, he was in the Recycle Bin - deleted by the Marketo sync user.

This opens up a few questions...

  1. He had the "Lead Was Deleted from SFDC" activity, hence why he showed up in the smartlist. But he wasn't deleted from SFDC. What circumstances can this occur? Answer: "Lead was deleted from SFDC" queries based on the activity occurring. It is not a reference to a state of deletion ("this person WAS deleted", not "this person IS deleted")
  2. I recall others' activity logs stating errors around "Failing to update SFDC record" because "record did not exist" (I'm paraphrasing).  However, that person definitely existed in SFDC. How can disconnects like this occur?
  3. Can I trust "Lead was Deleted from SFDC"? I used to batch these every day at a prior company, but now I'm hesitant. Answer: NOT if I'm expecting everyone who shows up to be currently deleted - only that they WERE deleted at some point.
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Steven_Vanderb3

Here's a scenario where this can occur.

Person is deleted from SFDC.  Marketo logs the "Lead was Deleted from SFDC" activity.

The lead is re-inserted into SFDC by Marketo via Sync Lead to SFDC flow step, program synced with a SFDC campaign, etc

That results in a record both having a deleted from SFDC activity in the activity log and currently existing in Salesforce.

2 replies

Josh_Hill13
Level 10
February 14, 2018

Screenshots?

Was the record in the recycle bin already and then restored later?

Why are you looking at records removed from SFDC and also trying to Delete from SFDC at the same time? Is this a cleanup?

Did you check the list before you let it run?

What does the log say exactly for each record?

Aaron_Dear
Level 3
February 14, 2018

Hey Josh - answers below!

1) Not as far as I know. I didn't check the Recycle Bin before running the batch campaign.
2) Yes - the goal was to remove any deleted persons from Marketo. I left the "remove from CRM = true" comamnd because... well, I didn't see a reason not to. Logically, if a person had been deleted in SFDC, I didn't see why would that make a difference. But, in the offshoot that it did, I could use the chance to learn more about the system (aka - this topic).

3)  I did check the list before I ran it - a question of you, what specifically did you want to inquire about on that list?

4) The records were deleted from system - it says nothing. After returning them from the Recycle Bin, it seems as if they are brand new records (new ID, new Marketo Created Date). They do have the correct SFDC ID.

Steven_Vanderb3
Adobe Employee
Steven_Vanderb3Adobe EmployeeAccepted solution
Adobe Employee
February 14, 2018

Here's a scenario where this can occur.

Person is deleted from SFDC.  Marketo logs the "Lead was Deleted from SFDC" activity.

The lead is re-inserted into SFDC by Marketo via Sync Lead to SFDC flow step, program synced with a SFDC campaign, etc

That results in a record both having a deleted from SFDC activity in the activity log and currently existing in Salesforce.

Grégoire_Miche2
Level 10
February 14, 2018

Hi Steven,

That's one possibility, as the activity log will keep a trace of the deletion.

Another possibility is that the lead is deleted in SFDC and then restored from the recycle bin. Personally, I would not take the risk to run this type of campaign 120 days later

The way we set this up, based on the fact that SFDC keeps records 15 days in the recycle bin:

Trigger :

Flow

Note that if the "remove from SFDC" is left empty, "Do Nothing" applies.

This design leaves 7 days in case someone would restore the record from the recycle bin, then deletes the record IF and only IF the record is still in a "delete" state in SFDC. This is all based on the fact that all SFDC record have an "is deleted" checkbox field that os set to True while the record is in the recyle bin. The "SFDC is deleted" filter checks that field.

-Greg

Aaron_Dear
Level 3
February 14, 2018

Solid decision - much more intelligent design than my recurring batch campaigns. Thanks Grégoire!

I left a comment below with some screenshots and an "ENTITY_IS_DELETED" error. Have you seen anything about that?