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
SeksakiSeksaki 

Not use trigger when calling api

Hello,
I use API calls from tanlend studio, the problem is triggered when I insert contracts from the API, a trigger that I set up at contract level is triggered,
how can I deactivate it or not launch it when I call the API

Thanks
Best Answer chosen by Seksaki
AnudeepAnudeep (Salesforce Developers) 
As far as I know you could create a custom setting that could be checked and unchecked when triggers should be skipped or not. In your trigger, only skip the code if the custom setting field is checked

This recommendation is made for all the scenarios where a trigger needs to be skipped. For example, see this discussion

Let me know if this helps, if it does, please close the query by marking it as solved. It may help others in the community. Thank You!

All Answers

SeksakiSeksaki
the problem is when the trigger is triggered i have the error : System.LimitException: Too many SOQL queries: 101
AnudeepAnudeep (Salesforce Developers) 
As far as I know you could create a custom setting that could be checked and unchecked when triggers should be skipped or not. In your trigger, only skip the code if the custom setting field is checked

This recommendation is made for all the scenarios where a trigger needs to be skipped. For example, see this discussion

Let me know if this helps, if it does, please close the query by marking it as solved. It may help others in the community. Thank You!
This was selected as the best answer
AnudeepAnudeep (Salesforce Developers) 
To avoid Too Many SOQL queries exception, see this article for suggestions