0

My issue is two fold -

I want to delete 350 Accounts. However these are the two blockers I have -

  1. Your attempt to delete 'account record' could not be completed because it is associated with the following opportunities
  2. You can't delete this account because one or more of its direct contacts are related to other accounts. Remove the indirect relationships, then try deleting the account again.

As a result I cannot use the OOB feature of 'Mass Delete Accounts' under setup.

My Approach: I am thinking of identifying the related opportunities and first delete those using data loader. Querying all of the related and direct Contacts of these 350 Accounts, and re-parenting them.
However, this would still be time consuming, and inefficient.

Question: Is there a better approach to delete these records. ?

2
  • What about just merging the Accounts?
    – David Reed
    Jun 1, 2020 at 14:23
  • Thanks @DavidReed, Business rules are such that these 350 records are not candidates for merging. Jun 1, 2020 at 14:25

1 Answer 1

0

If you have a query that returns those opportunities, you can use anonymous Apex. In the developer console or with workbench.

Use the delete dml statement.

Something like delete [Select id from Opportunity where AccountID IN (select id from account where FILTER_CLAUSE)];

Make sure to test your query first using a tool like workbench to make sure you don't have any records on them that you don't want deleted.

You must log in to answer this question.

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