Marketo Sales Insight Apex Trigger
Hello Community!
My SFDC Admin and I have been working on some data cleaning and updates in recent weeks. Until the end of May, we only pushed leads to SFDC when they hit a lead score of 40 and went to Sales. With the increase in lead generation from my team, this was causing issues if people hadn't reached the set score to sync but were calling into Sales (they couldn't find the lead, attribution was being mixed up etc).
So, after some troubleshooting to identify why leads were being throttled going into SFDC from a Marketo Smart Campaign, my Admin used Dataloader to push 23k leads into Salesforce as cleanly/quickly/easily as possible. She did this on June 11 and, since then, we've ended with a number of issues:
- Numerous notifications with the below error (I found this old thread for some reference but no solution):

- We were seeing a lot of duplicates hitting SFDC that were using the same email address which was odd (this is outside of the leads that were created by Sales for the above-mentioned gap)
- When I checked my Possible Duplicates Smart List in Marketo, it had gone from a pretty regular ~3k leads (we have a lot of clients that share an email address) to 48k, with 23k happening from June 11 onward - from reading the above thread it seems that this Trigger might cause duplicates?
Without context for this Apex Trigger (it's part of the MSI Managed Package), we're unsure how to address or fix it - my Admin has a ticket in with SFDC to hopefully get some insight (we had a vendor set up our SFDC and our Marketo instances in the past with little/no documentation left behind).
Musings/Thoughts:
- I can identify all the duplicate leads in Marketo and was considering deleting them en masse (including in SFDC) but that makes me nervous in general. I'm also making the assumption that, because their last update was June 11 onward, they're a duplicate because of this process vs being created in Marketo in the past and in SFDC before the sync happened (I can't verify each duplicate individually because of the volume).
- If I was to do the above, is this Trigger going to create more duplicates? If this error has shown up because of the bulk import, that's fine - we don't have a need/plans to do any further bulk imports.
Does anyone have any experience with this error and working with it? Any insight/advice/suggestions are always welcome.
TIA 😀