You need to sign in to do that
Don't have an account?
Shailesh Patel 7
DIVIDE List collection into sublist
i want to insert large number of records in Account Objects but as you know on salesforce governor limits is 10,000 records/DML so how can i divide list dynamic into sublist and is there any other way to insert list of records without exceed governor limits. i have been using batch class for it also. can you give me a sample code for my solution.
as per my knowledge there is a method for sublist in java but how can i do in apex?Please guide me.
Thanks in Advanced.
as per my knowledge there is a method for sublist in java but how can i do in apex?Please guide me.
Thanks in Advanced.
If you are in a batch context, try reducing the overall batch scope. It may get the number of records per execute down to a manageable level. Failing that, you may need to start a secondary batch job to process all the records that need to be updated.
Do you have a CSV file that is being split and then processed by a batch job? Have a look at Importing large CSV files via Batch Apex (http://developer.financialforce.com/customizations/importing-large-csv-files-via-batch-apex/). The limiting factor here will be the Apex processing time and heap limits. After that you just adjust your batch scope size small enough so that you stay within the 10,000 records process within DML statements.