function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kumaresan M 2Kumaresan M 2 

Issue in deleting parent record which has more than 70k records salesforce?

When i try to delete a parent record which has 70k records (in look up relation, parent is not mandatory) system taking too much time to delete parent record. Finally i am getting time limit exception in salesforce. I want parent needs to delete very fastly via VF page? Please suggest any solution. I dont want to use batch and/or any async process to do this?
bob_buzzardbob_buzzard
If you are hitting a timeout in salesforce, there's unlikely to be a VF solution that avoids this, given that VF still has to use Salesforce to delete this.  Have you set the lookup to delete the related record also?
Kumaresan M 2Kumaresan M 2
Thanks for your reply.. I am not deleting child records (70k). I am trying to delete a single parent reocrd which has 70k childs. Its in look up relationship alone. (not mandatory also). I didnt get what you meant? Can you explain ?
bob_buzzardbob_buzzard
When you create a lookup relationship you can say what happens to child records when the parent is deleted - one of the options is to delete all child records.  If this option is set it will cause a cascade delete of 70k records, which would explain the timeout.  If that isn't the case, then you might want to contact Salesforce support to understand why it is taking that long.
Kumaresan M 2Kumaresan M 2
Here child object is not cascade delete bw parent (look up with not mandatory). Thanks for clarifying me.. I will raise case with salesforce and will get back from them.