Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / Calculate Price Plug-i...
Sales forum
Unanswered

Calculate Price Plug-in Not Working on Create Records

Posted on by 47
Hello,

I'm seeking assistance regarding a pricing calculation plugin in the Dynamics 365 Sales application. I've disabled the automatic system price calculation and registered the plugin following the instructions on the Microsoft page: https://learn.microsoft.com/en-us/dynamics365/sales/developer/sample-calculate-price-plugin.

For testing purposes, I've registered the plugin for both opportunities and opportunity products, as outlined in the documentation, specifically on the CalculatePrice message, Post-operation event stage, and Synchronous execution mode. The plugin aligns with the provided documentation and successfully functions when updating fields of existing products or their prices.

However, when attempting to add a new opportunity product or opportunity, I encounter the following error: /An unexpected error occurred from ISV code. In the plugin trace log, I receive the message: 'Object reference not set to an instance of an object,' with ErrorCode: 0x80040224./

When I changed the execution mode to Asynchronous, the plugin worked, and the error disappeared. However, this is not an optimal solution as it doesn't provide accurate data in a timely manner.

How can I resolve this issue? Do I need to make any changes in the code or during the plugin registration process? Any assistance would be greatly appreciated.

Thank you in advance.

  • Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    Calculate Price Plug-in Not Working on Create Records
    Hi,
     
    Please refer to the following link which may be helpful.
     
    Best Regards,
    Dengliang Li
     

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,263 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,112 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans