When I try to merge two accounts that have sales opportunities, I get the following validation exception:

Cannot Delete Account Sales Opportunities Exist

Based on the dearth of Google hits for that term, I'm assuming this is a custom validation rule that we've set up on Salesforce at some point.

The only problem is that I can't find out where it lives. I've looked in...

  • Duplicate rules - nothing
  • Matching rules - only the 3 standard rules, none active
  • Duplicate Record Set Validation Rules - nada
  • Duplicate Record Item Validation Rules - zilch
  • Account Validation Rules - diddly squat
  • Account triggers - only those associated with installed apps

I may have forgotten other places I've looked and been disappointed.

Can anyone offer any pointers?

  • Have you looked at triggers? – SFDC Neuf Feb 9 '17 at 17:11
  • @SFDCNeuf Yep, the only ones there are managed triggers associated with installed apps. – Tom Wright Feb 9 '17 at 17:20
  • Just confirming did you check Account specific triggers/ Opportunity triggers too? – Rao Feb 9 '17 at 17:59
  • 1
    Yeah Validation Rules cannot fire on delete. If you set a lookup as required on the child object you might see some such error...check for custom Lookup relationships from Opportunity to Account. – Adrian Larson Feb 9 '17 at 18:24
  • 1
    @AdrianLarson This did it! It turns out that we have an app with a custom object called a "Sales Opportunity". I can't see the exact lookup implementation (it's a managed object), but I'm betting it's in here somewhere. – Tom Wright Feb 10 '17 at 9:08

In the end I've cornered this error to a lookup to a custom object managed by an app we have installed.

The confusion was caused by the fact that this custom object is called a "Sales Opportunity". When I read the exception ("Cannot Delete Account Sales Opportunities Exist") I assumed it was referring to a standard SF Opportunity object, which was a red herring.

| improve this answer | |

The only time I've seen a validation which didn't come from Apex that would prevent deletion is when a Lookup Relationship is marked as required. Notice that when you mark it as required, it forces you to select the option:

Don't allow deletion of the lookup record that's part of a lookup relationship.

Lookup Required

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.