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 :
Small and medium business | Business Central, N...
Answered

Force totals calculations of sales documents

(0) ShareShare
ReportReport
Posted on by 487

Hi Everyone,

I have been burning my brain on a bug I have in our BC implementation.

The issue: totals in sales documents are not calculated correctly, except when i go to change the discount % of the entire document.

Symptoms: When adding a new line, the quantity and unit price are multiplied and added to the totals. This happen BEFORE my code is executed. This code calculates the real quantities based on a new additional parameter further down the line and overrides the line total.

Possible fix: force to recalculate the totals AFTER my code has done its work. But I cannot find a way to do that?

Can anyone help please?

I have the same question (0)
  • Verified answer
    Avinash B Profile Picture
    1,455 on at

    Hi

    Does is your code is recalculating the Quantity? If yes, then validate the Quantity field which in turn takes care of calculation of Total.

    Regards

    Avinash B

  • Hedi Daneels Profile Picture
    487 on at

    Thank you so much Avinash. I have been trying to fix this bug since days. I did not now about the validate function and the link between those two. Thank you thank you thank you :)

  • Hedi Daneels Profile Picture
    487 on at

    Hi,

    I have a follow up question.

    In my code, when changing line X in my salesdocument, it will automatically change content in line Y.

    The new line total of line Y is not added to the total, even if i validate the quantity.

    I need idea how I can force line Y too please?

    Cheers

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,917

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,161 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,025 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans