+ Start a Discussion
AshishGargAshishGarg 

How to stop trigger to fire while uploading data using Data Loader

Hi,

I have a trigger on Account object in production environment. Although i have tried deactivating that trigger using n number of ways. But its not getting deactivated.

Now, i have lots of Account data to get uploaded using data loader. And i want that trigger not to fire.

Do we have any way to keep that trigger silent and let the complete data upload?? Thanks

imuino2imuino2

Did you try to de activate it?

Go to Setup -> Develop -> Apex Triggers. Choose the trigger, edit and then uncheck Is Active.

If that doesn't work what i would do is to edit the trigger and comment all the code. But only do this if necessary this is not the best way to do it.

 

Ignacio.

CoryCowgillCoryCowgill

Strange, you should be able to just deactivate it per the earlier post.

 

However, instead of commenting out the code as this is production and you may not want to essentially deactivate this trigger while users are on the system, another workaround is you can check the size of the trigger.new. inside the trigger.

 

If the size is Greater than 1 (Which would be the case for Data Loader) than don't do anything, else execute your code logic.

Rahul S.ax961Rahul S.ax961

Hi,

 

I think for deactivating the trigger,

you should deactivate it in sandbox and deploy it again to production.

Hope that help.