Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Calculate Price Plug-in Not Working on Create Records

(1) ShareShare
ReportReport
Posted on by 51
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
    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
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Holly Huffman Profile Picture

Holly Huffman 103

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 96 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 51 Most Valuable Professional

Product updates

Dynamics 365 release plans