Monday, 17 August 2015

Maximum records to be processed by a trigger is?


I am not going for any documentation right away, hope I will clear this on my own.

Trigger will be called when you perform any action on object record. Lets say I want to insert 50,000 records. I have a trigger in which some logic is written (may be some validations etc..).

Now there are different ways to insert records. I will go with data loader first. When I am inserting record with data loader then it insert the record in packets of 200 at a time. Means my trigger will be processing not more than 200 records.

Same case applies with batch class - maximum batch size can be 200. So here also my trigger will process not more than 200 records.

Now another way is to write an apex class which will insert records. As I have already mentioned that only 10,000 records will be processed at a time. So in this case my trigger will not be processing more than 10,000 records.

This flow is designed in a very smart way, that is why I love salesforce.

No comments:

Post a Comment