+ Start a Discussion

Delete id limit reached error



I'm trying to run a Java application that bulk deletes records from Salesforce. However, I get the following error:


[UnexpectedErrorFault [ApiFault  exceptionCode='EXCEEDED_ID_LIMIT' exceptionMessage='delete id limit reached: 200']]


Here is my code (simplified):


public static DeleteResult[] deleteFiles(PartnerConnection conn, String[] idsToDelete) throws Exception




return conn.delete(idsToDelete);


catch(ConnectionException e)


logger.debug("Exception occured: " + e.getLocalizedMessage(), e);

throw new Exception("Exception occured: " + e.getLocalizedMessage(), e);




where I pass 9000 IDs into the array. Which limit am I hitting and how can I change this limit?



Best Answer chosen by Admin (Salesforce Developers) 

There is limit on the number of Id;s which can be passed to delete() call. 

 In version 7.0 and later, you can pass a maximum of 200 object IDs to the delete() call. In version 6.0 and earlier, the limit is 2,000.


you can find further details at Link.


Solution for this could be limiting the the delete call for 200 Ids by breaking those 9000 Ids in the batches of 200.