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
  • Suggested answer
    YUN ZHU Profile Picture
    85,674 Super User 2025 Season 1 on at
    Update Subtotal Excl. VAT
    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
  • Suggested answer
    Ariba Mehdi Profile Picture
    160 on at
    Update Subtotal Excl. VAT
    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!

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans