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

Bulk trigger idiom

I was wondering if i only want a trigger to only happen on the interface i.e. as don't want this to happen in a bulk upate in data loader can i just always just manipulate the first record on the trigger list


//Some trigger on account which should only happen in user interface


Account acc =;


//do some stuff with acc?

Best Answer chosen by Admin (Salesforce Developers) 



  1. While you may think that the trigger will only fire for the user interface use case; you may find down the road that you need to do bulk updates using the Data Loader or Excel Connector and you will regret this shortcut.  I know, I did.  Therefore, best practice is to always write triggers using the bulk trigger idiom which is well documented in the SFDC Apex Developer Guide and also in the Cookbook. 
  2. To your specific question, the expression: is a List of whatever sObject your trigger is written for.  Therefore, the first (and only) element will always be the record triggered by the UI.
Message Edited by crop1645 on 11-09-2009 09:56 AM