views:

32

answers:

1

I've got a bit of a weird situation in MS CRM 4.0.

The quote form contains extra, custom elements which contain the calculated value with taxes already added; these are not handled by the CRM automatically, and since the laws over here can be tricky, it's best to leave this up to the user to pick the tax rate on various items.

Needless to say, my plugins have to calculate this total amount on their own. I've managed to do this using pre plugins when creating and updating quote detail elements; a child step is registered on pre quote update, which calculates the proper amount using a shared variable (passed on from the parent context of either pre update or pre create quote detail elements).

However, things get strange when I try to do the same with the delete message on a quote detail. First a pre delete message step is fired, as expected. In this step, I created the shared variable which contains the calculated total value of each quote detail that is not deleted. Then I expected a pre update step on quote to be fired, with the parent context being the delete step quote detail... it is not so: instead, the parent context is a quote retrieve step.

As such, I am unable to calculate the total tax value, as I cannot use the shared variable (different contexts). I also cannot use the retrieve step, as within it I won't have the information about which quote detail will in fact be deleted (at this point it hasn't been deleted yet).

This retrieve step was a rather unpleasant surprise. Is it normal? If so, what can I do to pass a shared variable from the quote detail delete step?

A: 

While this particular case of delete step is indeed handled differently in the CRM using the retrieve step, the problem I had was not clearing the cache in my plugin, therefore getting the quote details along with the one that was deleted.

Shaamaan