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
SalesForce CRMSalesForce CRM 

Diiferentiate SalesForce Record and Data Loader Record

Hi i want to execute a trigger when the records are bulk imported , i do not want to execute that trigger when the records are created from sales force how can i achieve this task.
 
 
Thanks
Anand.
mikefmikef
In your trigger check to see if Trigger.new is greater then 1.

Process all requests if Trigger.new is greater the 1.
SuperfellSuperfell
what happens when your data load is 2001 rows :)
mikefmikef
Please explain, cause I thought you can only pass in batches no greater then 200.
SuperfellSuperfell
so in batches of 200, for 2001 rows, you get 10 batches of 200 followed by a single batch with a single row.
mikefmikef
duh :-O

Sorry I shouldn't have come up with that solution Friday right before I went home.

So is there a way to check and see if this is UI created record vs. an API created record?