Skip to main content

Notifications

Announcements

No record found.

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

  • Nikhil Kumar Kakkireni Profile Picture
    on at
    RE: salesorder recalculate feature execute with code

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

  • Emre GULCAN Profile Picture
    2,379 on at
    RE: salesorder recalculate feature execute with code

    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)

  • Verified answer
    David Jennaway Profile Picture
    14,065 on at
    RE: salesorder recalculate feature execute with code

    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
    RE: salesorder recalculate feature execute with code

    Is there any idea?

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans