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
AloneAlone 

Trigger

 

I want to create a trigger ( after insert) in custom object, which will updated same custom object by selecting value from another custom objects.

 

I have to upload records into this custom object using data loader with more than 30000 records

 

what all the things  I need to take care before developing trigger in respect of governor limits and how can make sure the trigger will no throw error if once data loader process starts.

 

Best Answer chosen by Admin (Salesforce Developers) 
Afzal MohammadAfzal Mohammad

This should get you going.

 

http://wiki.developerforce.com/index.php/Apex_Code_Best_Practices

 

Its got good info on following

 

  • Best Practice #1: Bulkify your Code
  • Best Practice #2: Avoid SOQL Queries inside FOR Loops
  • Best Practice #3: Bulkify your Helper Methods
  • Best Practice #4: Using Collections, Streamlining Queries, and Efficient For Loops
  • Best Practice #5: Streamlining Multiple Triggers on the Same Object
  • And so on...

Hope that helps.

 

Afzal

All Answers

Afzal MohammadAfzal Mohammad

This should get you going.

 

http://wiki.developerforce.com/index.php/Apex_Code_Best_Practices

 

Its got good info on following

 

  • Best Practice #1: Bulkify your Code
  • Best Practice #2: Avoid SOQL Queries inside FOR Loops
  • Best Practice #3: Bulkify your Helper Methods
  • Best Practice #4: Using Collections, Streamlining Queries, and Efficient For Loops
  • Best Practice #5: Streamlining Multiple Triggers on the Same Object
  • And so on...

Hope that helps.

 

Afzal

This was selected as the best answer
AloneAlone

Thank you Afzal,

 

My concern here is even if bulkify my and reduce the number of SOQL quaries etc, how if I upload the data of 30000 + manages govenor limits..

 

How data loader handles the bulk datas, is Dataloader uploads data in batches ?

 

 

 

Anoop 

Afzal MohammadAfzal Mohammad
Yes, it does uploads data in batches. You may set the desired batch size in data loader's preferences/settings. Hope that helps. Afzal