Is there a limit to the number of records that can be deleted in cascading delete?

We are receiving an error "Deletion Unsuccessful You cannot delete this object" when trying to delete records involved in master detail and lookup cascade delete relationships.

It is my understanding their are limits on delete() functions in Apex, but is there delete limits in the declarative delete functionality?

  • 2
    Have you checked if any of the objects in your cascade have references from any other objects? – kresho Mar 27 '14 at 21:06
  • Yes, there are references from other objects. But it seems to allow delete on "small" amount of records and "error" on larger amounts of records. – Justin J Carlson Mar 28 '14 at 19:10

From Considerations for Relationships in the Salesforce Help:

In a many-to-many relationship, a user can't delete a parent record if there are more than 200 junction object records associated with it and if the junction object has a roll-up summary field that rolls up to the other parent. To delete this object, manually delete junction object records until the count is fewer than 200.

It may be that the records you're deleting are falling under this limitation.

| improve this answer | |
  • We spoke to Partner Support about this and confirmed. According to support, the rule stated above applies to junctions with or without roll-up summary fields. Did not get a clear answer about why the documentation specifically includes the Roll-up summary criteria. Do you have any insight into this? Thanks! – Justin J Carlson Apr 16 '14 at 13:52
  • Asking the product owner and writers -- please hold... – shannonsans Apr 16 '14 at 21:49

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.