You need to sign in to do that
Don't have an account?
![dmays dmays](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
How to increase batch size for insert
We're trying to do an initial load of Salesforce with Accounts and Contacts, but have run into a maximum batch size of 200 records. Is there any way to increase this?
Are you saying it cannot be increased? We have 140,000 accounts to upload and our product people were told we would be able to do it in batches of 50,000.
I don't think loading this many should take too long.
A batch of 50,000 would create a soap message that would be enormous and likely crash whatever soap client you are using due to memory issues.
Are you writing your own software to load the data, or using a third-party tool?
In 4.0, the limit was 2,000. In 5.0, when we added things like long text custom fields, we decreased the limit to 200 since the messages can be much larger. I think you'll still find the throughput to be good, even though you need to make more web services calls. The time to load into the system is larger than the network time.
I'll give you some pseudo code if you like... What I did when I wrote my import util was to declare an sObject array (insSobjects[]). I also had a function that would 'append' another sObject to that array and resize the array. (In essence get length of array, make new one length+1, call Array.Copy, and add the new element on the end)
In my code I'd do something like this:
while (1==1) // Loop utnil whenever you're done...
{
Account impAccount = new Account();
// Do stuff here to popluate the impAccount object
insSObjects = utils.addSobject(insSObjects, impAccount); // Add the new account to the sObject Array...
if (insSObjects.Length >= 199)
{
// Call sfBinding.Create and process the results for errors
insSObjects = new sObject[0];
}
}
This would loop through, add my accounts, and send them to Salesforce in batches. I'll also note I had ALOT fewer records you do and I took the time in the weeks preceeding cutover to do alot of import runs and gave exception reports to my client to have the records 'fixed' before import day.
Best o' luck to ya.