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
Cable Guy.ax375Cable Guy.ax375 

Delete 200 Records Each Time

Can anyone give me the sample code of deleting 200 records each time for a table of 50000 records? I'm using SFDC Java API version 7.
 
Thanks, 
SuperfellSuperfell
You'd probably have more luck if you posted what you've got and asked specific questions.

If i was writing it, i'd structure it like this
set batch size to 200
query for the ids
loop
read the ids from the currents results into an array
call delete
exit if done
call querymore
loop end
SuperfellSuperfell
BTW, If this is a one-off delete you want to do, just use the Data Loader tool.
Cable Guy.ax375Cable Guy.ax375
How come when I write:QueryOptions qo = new QueryOptions(); It complains "QueryOptions cannot be resolved to a type"? Im using API version 7 and the import statement imports com.sforce.soap.enterprise.*;
 
 
SuperfellSuperfell
Its probably called _QueryOptions, look in the directory at the files you have.
Cable Guy.ax375Cable Guy.ax375
It's working! Thanks so much.
 
Btw, can you move the question I posted "Delete Massive Data" from the top?