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
AbAb 

Executing triggers for 100000 Records

Hello,

While updating records using data loader, do the triggers execute ?

If not, what are other ways of updating records where i can make sure that the triggers execute.

Thank you for suggestions
Best Answer chosen by Ab
Anil kumar GorantalaAnil kumar Gorantala
triggers fire while using dataloader. no need of extra things.

All Answers

Anil kumar GorantalaAnil kumar Gorantala
triggers fire while using dataloader. no need of extra things.
This was selected as the best answer
AbAb
How are DML limitations taken care of ?

For example, on object i have 6 triggers, do all work correctly ?
Anil kumar GorantalaAnil kumar Gorantala
Before I give you an example, it’s important to know exactly why you need to bulkify:
Up to 200 records can enter your trigger at once!
Remember Trigger.new? Salesforce will batch up mass updates and include up to 200 records at once in it (this commonly happens when using tools like Data Loader). So for example, if you do one SOQL query per record, you’re going to go over the 100 SOQL query limit!
Triggers are on the same shared Governor Limit!
Got ten triggers that run when an Account is updated? Each trigger does not get its own set of limits! One limit per update, no matter how many triggers are run! This means that if each of your ten triggers runs 12 SOQL queries, you will run a total of 120 SOQL queries and go over the100 SOQL query limit! This means you need to be extra conservative!
You will be tested on bulkification during your job interviews
You can’t have code in a production org that’s not bulkified because your users will get errors! That’s why every job interview specifically tests for this knowledge. The good news is that 90% of people I interview do not understand how to bulkify, so this is your chance to stand out!
Anil kumar GorantalaAnil kumar Gorantala
A few general best practice for triggers that applies generally
1. One Trigger per object
2. Keep SOQL queries outside of loops by leveraging collections (Lists, Sets, Maps)
3. Keep DML outside of loops by leveraging collections (Lists, Sets, Maps) and performing DML on a collection rather than individual records
4. Keep logic outside of the trigger itself. Keep your logic in helper classes that helps in making your code portable and reusable.
Ramssf70Ramssf70
Hi Sandrine,
  while uploading data from data from loader automatically trigger  will fire we don't need to  write any code for that