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
pradyprady 

What is the limit on the no of records inserted from a trigger

Hi,

 

Do governor limits apply when i use a insert using a list.

 

For eg. i add all the records to be inserted in to a list and finally give a insert list. I might have 3000 records in the list

Does it take as one DML statement or does it take as 3000 DML statements?

 

Thanks

 

Best Answer chosen by Admin (Salesforce Developers) 
amidstcloudamidstcloud

prady

 

It will be count as a single DML statement when you update a list .  You can check DML statement in debug log too. 

   

Update list;  

 

Debug Log:-

Number of DML statements: 1 out of 150

All Answers

bob_buzzardbob_buzzard

Governor limits do still apply - these are across the entire transaction, so triggers that are fired from an insert also impact the limit.

 

I'd always recommend inserting via a list, as you reduce the number of DML calls required (which is limited to 150).

amidstcloudamidstcloud

prady

 

It will be count as a single DML statement when you update a list .  You can check DML statement in debug log too. 

   

Update list;  

 

Debug Log:-

Number of DML statements: 1 out of 150

This was selected as the best answer
pradyprady

So if i use

 

insert ListA

 and ListA has 3000 records would this be considered as 1 DML statement ?

pradyprady

Thanks Ankit , Bob

 

Ankit- Just saw reply after i posted my earlier response

bob_buzzardbob_buzzard

It would.  FYI there is also a limit on the maximum number of records that can be affected by DML, which is 50,000.