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
ramesh k 29ramesh k 29 

how to control a trigger when importing data through data loader

vishnu Rvishnu R
hi,

you can't control trigger firing while importing data in salesforce via dataloader ...one and only way is to deactivate the trigger before importing data and re-activate it after the import.

thnaks
vishnu Rvishnu R
hi,

it is not possible...if you want this functionality upvote this idea

https://success.salesforce.com/ideaView?id=08730000000l75PAAQ

thanks
Hugo_HernandezHugo_Hernandez
Hi ramesh k 29

As such it isn't possible but there a solution from your apex code in the trigger.


 
trigger passingCampaingLeadToAccount on Lead (after update, before insert) {


	if (trigger.new.size() > 1) { // <-- the validation count the size of records to insert or update  
		System.debug('can\'t in');
	}

}

The word "trigger.new" is a List and is possible validate the size, the trigger only will execute when an user insert a lead from UI (User interface)

Regards from México :D