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
MigMig 

Maximum number of records we can create with apex code

I would like to know what is the maximum number of records ( of the same object) an Apex class or trigger can make in one shot ?
And how to do it ( Bulk trigger I suppose , and what more ? )

After some research :

1. Trigger 2.Visualforce Controler 3. Run Test

Total number of DML statements issued (insert, update, upsert, merge, or delete)20100^100
Total number of records processed as a result of DML statements100****10,000^500



I don't understand the difference between the total number of DML statement and the total number of records processed as a result of DML statement.

If I need to create 300 records. I do need to make 300 update calls ! Right ?


Thankx a lot for this informaion. I actually need this confirmation for tomorow so I'm keeping try to find out ...

Tkx to all of you.

MC



Message Edited by Mig on 09-18-2008 01:27 PM
TehNrdTehNrd
Total number of DML statements is how many times you execute a DML statement.

Code:
List<Opportunity> opps = new List<Opportunity>();

insert opps;
update opps;
delete opps;

This would be 3 DML statements

For triggers you can only insert/update/delete a max of 100 records total.

So if you insert 30 opps and then update 40. You are at 70.