You need to sign in to do that
Don't have an account?
TehNrd
OpportunityLineItem delete trigger doesn't execute on Pricebook change?
When you change a pricebook on an opportunity all products are deleted.
So you would think that any delete triggers on OpportunityLineItem would execute, but they do not.
Is this by design?
So you would think that any delete triggers on OpportunityLineItem would execute, but they do not.
Is this by design?
Since you say "interim" does this mean that a cascade delete will someday eventually cause triggers to execute?
Oddly, I was just testing some code and I'm not sure you can detect a change in the Pricebook2Id for the opportunity. I created a Before Update trigger on Opportunity and for some reason when I change the pricebook for any given opportunity (trigger.old[i].Pricebook2Id) is equal to (trigger.new[i].Pricebook2Id). They both always report the new value.
It's acting like it changed it prior to executing the the before update trigger. What Gives? How are you supposed to detect a change in the pricebook if the new values are always equal to the old values? Any ideas or workarounds out there?
OK.... Figured it out. You can detect the pricebook change in the New Opportunity Save Behavior, but you Can't in the Old Opportunity Save Behavior.
This could be a dangerous issue for some apps. Look out! :smileysurprised: