You need to sign in to do that
Don't have an account?

Can I prevent a "before insert, before update" Apex Trigger from firing if a checkbox = true?
I need to prevent an Apex Trigger from firing during the cloning of a record. Can I use the value of a checkbox to prevent the trigger from firing?
All Answers
try
if(Trigger.Before) {
for(YourObjectName obj : Trigger.new/old(depending your scenario)) {
if(obj.IsCloned__c) {
//Do your logic
}
}
}
if(Trigger.Before) {
for(YourObjectName obj : Trigger.new/old(depending your scenario)) {
if(obj.IsCloned__c) }
else{
(Trigger.new[0].checkbox__c)
}
}
}
}
I hope you get best answer then contact me at Mypremiercreditcard (https://mypremiercreditcard.website)