Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

Update Subtotal Excl. VAT

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
Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 68,480 Super User 2024 Season 2 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
    Ariba Mehdi 156 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!

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,263 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,112 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans