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
Sudheera LakmalSudheera Lakmal 

Delete id limit reached 200

I have a list button to delete all the records in a particular related list. The Deletion portion of the JacaScript is below.

  User-added image

However, when I click the Delete button I recieve below error.

User-added image

Later I noticed that related list contain around 600 records. Based on the error message It seems that we can send only 200 records for the deletion method at once. Only solution I can think about is to send the IDs with 200 batches to the sforce.connection.deleteIds() method, which is certainly our business users don't want to have.
Does anybody have different approaches to address this issue?
Amit Chaudhary 8Amit Chaudhary 8
Try to remove java script code and use salesfore batch job or you can open the VF page on click on button to delete the record
Ravi Dutt SharmaRavi Dutt Sharma
In your if condition where your are checking the user response is true or not, call an apex function there. Delete the records in apex instead of javascript. To call your apex function from javascript, use apex:actionFunction
Sudheera LakmalSudheera Lakmal
@Amit, @Ravi - Thanks for your replies.

Could you please share an example? I'm new to Salesforce and I don't have an idea how to try your suggestions.