web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Nagaraju_Matta Profile Picture

Nagaraju_Matta 121

#2
ManoVerse Profile Picture

ManoVerse 73 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 66 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans