4

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?

6
  • Have you looked at triggers?
    – SFDC Neuf
    Commented Feb 9, 2017 at 17:11
  • @SFDCNeuf Yep, the only ones there are managed triggers associated with installed apps.
    – Tom Wright
    Commented Feb 9, 2017 at 17:20
  • Just confirming did you check Account specific triggers/ Opportunity triggers too?
    – Rao
    Commented Feb 9, 2017 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
    Commented Feb 9, 2017 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
    Commented Feb 10, 2017 at 9:08

2 Answers 2

1

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.

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .