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 :
Microsoft Dynamics CRM (Archived)

salesorder recalculate feature execute with code

(0) ShareShare
ReportReport
Posted on by 2,379

Hi all,

I need to execute OOB "salesorder recalculate price" feature with code (c# or call webapi etc). Is there any way to do it?

My problem is;

I have a salesorder and multiple items (salesorderdetail), for exp. total amount is 10$. If I delete a salesorderdetail (2$ price) with web API call salesorder 's totalamount does not calculated until open record from UI. when you check advanced find still see 10$.

When I develop XrmLibrary I found something like this but a bit different, when you convert salesorder to invoice with SDK (ConvertSalesOrderToInvoiceRequest) invoice total amount not calculated until open record or perform any request on this record with SDK (https://github.com/emregulcan/xrmlibrary.2015/issues/5) .

Regards

*This post is locked for comments

I have the same question (0)
  • Emre GULCAN Profile Picture
    2,379 on at

    Is there any idea?

  • Verified answer
    David Jennaway Profile Picture
    14,065 on at

    This may sound a bit odd, but try using a Retrieve request on the salesorder, and include the totalamount column in the column set. CRM does the recalculation on a Retrieve

  • Emre GULCAN Profile Picture
    2,379 on at

    Hi David,

    Thank you for your response, I discovered this little trick before.

    This buggy feature inside all SFA entities and I think it's about SQL command running order. Retrieve or other update request messages trigger calculation process (details on github.com/.../5)

  • Nikhil Kumar Kakkireni Profile Picture
    Microsoft Employee on at

    Please use review.docs.microsoft.com/.../recalculateprice-action

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 Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans