SOLVED

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

Go to solution
Highlighted
Level 3

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

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.
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Marketo Employee

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

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.

View solution in original post

12 REPLIES 12
Highlighted
Level 10 - Champion Alumni

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

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?

Highlighted
Level 3

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

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.

Highlighted
Marketo Employee

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

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.

View solution in original post

Highlighted

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

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 :

pastedImage_5.png

Flow

pastedImage_7.png

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

Highlighted
Level 3

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

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?

Highlighted
Level 2

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

Hi Greg,

Late to the party, but had a follow up question regarding your smart campaign.

In the instance I inherited there was a second trigger (Data Value Changes) is that trigger necessary for the campaign to run properly?

thanks Mark

pastedImage_2.png

Highlighted
Level 3

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

Hey Steven,


I ran your test scenario through - I expected this might be the case as well! I also wanted to test conditions with the recycle bin...

  • First, I deleted my test lead in Salesforce
    • SFDCisDeleted=TRUE now...
  • Then, I ran a batch campaign to Sync to SFDC
    • SFDCisDeleted=FALSE now...
    • Syncing occurred without a problem
  • I deleted my test lead in Salesforce, then deleted him from the recycle bin
    • SFDCisDeleted=TRUE
  • I ran a batch campaign to Sync to SFDC
    • SFDCisDeleted=FALSE again
    • Syncing occurred without a problem
  • I opened a SmartCampaign to filter for "Lead was deleted from SFDC"
    • Filter: email is my lead's email, and "Lead was Deleted from SFDC" in last day. The lead shows up, and is simultaneously in SFDC. You're right!

There's still a weird message I was seeing yesterday though... Below are screenshots I took showing a lead who was not deleted, but was getting a strange error message.

This person had "SFDC IS Deleted = FALSE", but "Lead was Deleted from SFDC". I highlighted that below.

1) SFDC is Deleted is false.png

In the Activity Log, that person gets these activity records (ENTITY_IS_DELETED) whenever I attempt a sync to SFDC. Note: I didn't notice at the time.

2) Deleted from SFDC.png

A while later, subsequent sync attempts still occur - but Marketo continually lets us know the person is deleted from CRM because - I imagine - that SFDC ID no longer existed.

3) Entity is Deleted.png

Are you acquainted with this issue?

Highlighted

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

Hi Aaron,

When the lead is deleted in SFDC, Marketo does not remove it's SFDC ID and will attempt to sync it when it's updated (implicit sync) in Marketo.

-Greg

Highlighted
Marketo Employee

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

I haven't seen that error message before but I poked around in the SFDC docs.  I think it's occurring because that SFDC record is still in the Recycle Bin.  Marketo is trying to interact with it but it can't because it's in a soft deleted state in Salesforce, so a message comes back that the entity is deleted.