简体   繁体   中英

CalculatePrice message in Dynamics CRM

I have been assigned to maintain customization code developed by consultants. This code includes a custom price calculation plugin that is based on a Microsoft example . As per documentation , the plugin has been registered to fire on the CalculatePrice message.

While debugging the code, I noticed that just loading or refreshing a Quote would cause the CalculatePrice message to be fired. Further investigation seems to confirm that issuing a Retrieve message triggers a CalculatePrice message (sort of corroborated on GitHub ).

快速观察上下文变量

This behavior makes no sense to me. It results in performance penalties and unnecessarily large transaction logs. Logically, the only time CalculatePrice should fire is on Create or Update messages of relevant records/fields (kind of like workflow activities).

As such, here are some questions:

  1. Is anyone aware of good documentation on the topic?
  2. Is this out-of-the-box behavior or a result of incorrect configuration?
  3. If this is out-of-the-box behavior, what is the reason/justification for it?
  4. Is there harm in altering code to return if parent context message is Retrieve ?
  5. Has anybody else ran into this? If so, how did you solve it?

Any answer(s) would be greatly appreciated.

从销售补丁版本9.0.1904.XXXX Dynamics CRM将不会始终在检索消息中触发PriceCalculation。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM