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...
Suggested Answer

Update Subtotal Excl. VAT

(0) ShareShare
ReportReport
Posted on by
Article := GetServiceArticleNo();
SalesLine.SetRange(/Document Type/, Rec./Document Type/);
SalesLine.SetRange(/Document No./, Rec./Document No./);
SalesLine.SetFilter(/No./, '=%1', Article);
if (SalesLine.Count <> 0) and (SalesLine.FindFirst()) then begin
PriceListLine.SetRange(Status, PriceStatus::Active);
PriceListLine.SetRange(/Product No./, SalesLine./No./);
PriceListLine.SetRange(/Source Type/, SourceType::/All Vendors/);
PriceListLine.SetFilter(/Starting Date/, '<=%1', DueDate);
PriceListLine.SetFilter(/Ending Date/, '>=%1', DueDate);
if PriceListLine.FindFirst() then begin
SalesLine.Validate(Quantity, Round(MontageSum / 60, 0.01));
SalesLine.Validate(/Unit Price/, Round(MontagePrice / SalesLine.Quantity, 0.01));
SalesLine.Modify;
end;
end

I have the issue with update Subtotal Excl. VAT after this code, is not updated after recalculation
I have the same question (0)
  • Suggested answer
    Ariba Mehdi Profile Picture
    166 on at
    Hi there, 

    For the business central's out of the box field, we use Event Subscriber to modify the value of the field. 
    For this, create a code unit and use the relevant event subscriber and pass the record to the codeunit. 

    Here's an example of how:

    Look for OnAfterCalculateSalesSubPageTotals in the Document Totals codeunit. Do the changes and modifications inside this method. 
     
    Incase this event subscriber doesn't work, try debugging, or try some other event subscriber methods in the Document Totals codeunit or by exploring how Subtotal Excl. VAT field is being calculated.

    Hope this helps!
  • Suggested answer
    YUN ZHU Profile Picture
    95,546 Super User 2025 Season 2 on at
    Hi, hope the following can give you some hints as well.
    Dynamics 365 Business Central: How to add new fields to Total Area on the Document Subform page (View Total Quantity, Number of Lines on the Sales Order)
     
     
    Thanks.
    ZHU

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 3,151

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans