You need to sign in to do that
Don't have an account?
Disabling a Trigger
Hey SF Dev Community,
I created a trigger that has one error in it. I need to disable it as I've already created a new change set with the fix, what's the best method to do this?
Thank you
If you replace the code in Sandbox and push to Production, the code in Production will be replaced by your change.
Always try to backup your code before pushing to production (i.e. source control, etc).
Thanks
All Answers
You can either comment out the trigger code or you can set a flag using a custom label:
Thanks
If you replace the code in Sandbox and push to Production, the code in Production will be replaced by your change.
Always try to backup your code before pushing to production (i.e. source control, etc).
Thanks
Quick question...
Do you know how to add "does not contain" to an Apex trigger?
For example, I have the following code:
trigger TaskTrigger on Task (before insert, before update) {
for(Task ta: Trigger.new) {
if(ta.Task_Results__c != null && ta.Subject != ta.Task_Results__c) {
ta.Subject += ' ('+ta.Task_Results__c + ')';
}
}
}
What's happening is every time a user "Edits" and "Saves" a Task, it's duplicating the Task Result value in the Subject line. I only want this to happen once. Is there a way to add "and ta.Subject DOES NOT CONTAIN ta.Task_Results_c" or ONLY UPDATE ONCE?