+ Start a Discussion
si risi ri 

how to bypass trigger when submitting the custom VF page

Hi experts,
Can we  bypass a trigger when submitting the custom VF page?
Best Answer chosen by si ri
Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

A trigger will fire automatically whenever the record is inserted or being updated until it has been deactivated. You can skip triggers by checking certain conditions so that it doesn't affect any data of salesforce database.

You can add a dummy checkbox field that is not visible to anyone and let the trigger bypass the record if the checkbox is checked or true. You can also use Custom Setting to bypass trigger. Please refer to the below links which might help you further.

http://www.salesforcegeneral.com/salesforce-articles/salesforce-bypass-rules-and-triggers.html

https://salesforce.stackexchange.com/questions/98709/bypass-triggers

http://sfdccloudcomputing.blogspot.com/2013/12/bypass-trigger.html

http://www.infallibletechie.com/2018/10/how-to-bypass-all-triggers-validation.html

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

A trigger will fire automatically whenever the record is inserted or being updated until it has been deactivated. You can skip triggers by checking certain conditions so that it doesn't affect any data of salesforce database.

You can add a dummy checkbox field that is not visible to anyone and let the trigger bypass the record if the checkbox is checked or true. You can also use Custom Setting to bypass trigger. Please refer to the below links which might help you further.

http://www.salesforcegeneral.com/salesforce-articles/salesforce-bypass-rules-and-triggers.html

https://salesforce.stackexchange.com/questions/98709/bypass-triggers

http://sfdccloudcomputing.blogspot.com/2013/12/bypass-trigger.html

http://www.infallibletechie.com/2018/10/how-to-bypass-all-triggers-validation.html

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
This was selected as the best answer
si risi ri
Hi Khan Anas,
Thank you it works.