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
admin sureshadmin suresh 

can we bypass triggers, workflows and validation rules while loading data using dataloader? how can we do this?

Abilash Kosigi 8Abilash Kosigi 8
Hi Suresh,

Before loading an object into salesforce, you can deactivate the triggers and validation rules on it. Thereafter, once you load using apex data loader these are overrided. 
Frédéric TrébuchetFrédéric Trébuchet
Hi Suresh,

Deactivating triggers and validation rules may be a solution if you don't have to do that every day.
A best alternative is to include that in your business logic having an hidden checkbox you set to TRUE when you want to bypass the triggers, validation rules and workflow.
Then, you have to ckeck the value of this field for every component you want to allow the bypass.
Good explanation here http://lunego.com/blog/ignore-validation-rules/ and here https://developer.salesforce.com/forums/ForumsMain?id=906F00000009FRoIAM for example.

Best regards,
Fred
 
Frédéric TrébuchetFrédéric Trébuchet
Hi Suresh,

Notice that it is a good practice to have a mecanism to deactivate rules, workflow and triggers based on custom setting.
Mark your question Solved if these answers help you, and don't forget to flag the best one.

Regards,
Fred
 
admin sureshadmin suresh
Hi Fred,

Thank you for ur answer.. can u provide how to do custom setting (logic for trigger bypass), because i am new to sfdc.
Frédéric TrébuchetFrédéric Trébuchet
Hi,

Does this answer help you solved your problem?
If so, mark the question as Solved and kindly select the best answer.

Thanks,
Fred
 
Nick McGirrNick McGirr
Frederic--


How do you get this method to apply for a workflow rules filter?
http://learnsf.wordpress.com/2011/05/21/disable-validation-rules-4-data-load/
Nick McGirrNick McGirr
It does not show up as an option to filter on from filter criteria's picklist.