web
You’re offline. This is a read only version of the page.
close
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 55
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.

I have the same question (0)
  • Dengliang Li Profile Picture
    Microsoft Employee on at
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 81 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

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

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans