You need to sign in to do that
Don't have an account?
RDN_LHR
Can I cause Trigger to fire only before delete called from UI?
I currently have a "before delete" trigger on OpportunityLineItem which stops line item records from being deleted if certain conditions are met.
Is there a way use an if to say that if the delete call is coming from the API or is due to a delete on the parent Opportunity record, to ignore the steps in the trigger? I'd only want the steps to execute if the trigger is called from a line item delete via the UI.
I thought I read this once somewhere, but after all my searching, I can't seem to find it.
Anybody know?
Thanks!!
Usually you would solve this by surrounding your effective trigger code by if(Trigger.new.size() == 1) { // Triggercode }.
This assumes the API never is used for only 1 record at once.
All Answers
Usually you would solve this by surrounding your effective trigger code by if(Trigger.new.size() == 1) { // Triggercode }.
This assumes the API never is used for only 1 record at once.