web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Update Totals on Subform

(0) ShareShare
ReportReport
Posted on by 358

I have created 2 fields by extending the Sales Line table.

  1. Premium % (Decimal)
  2. Premium Amount (Decimal)

These two fields will be shown on the Sales Order Subform and will function like how Line Discount % works. It is just that, it will add the Premium Amount value to the Line Amount instead how Discount % subtracts Line Discount Amount from Line Amount.

Here is the code I have written;

 layout
    {
        addafter("Line Discount %")
        {
            field("Premium %"; "Premium %")
            {
                ApplicationArea = All;
                BlankZero = true;
                trigger OnValidate()
                begin
                    Update_Premium_Amount();
                end;
            }
            field("Premium Amount"; "Premium Amount")
            {
                ApplicationArea = All;
                BlankZero = true;
                trigger OnValidate()
                begin
                    Update_Premium_Percentage();
                end;
            }
        }

    }
    
    
    
     local procedure Update_Premium_Amount()
    var
        percValue: Decimal;
    begin
        Clear(percValue);
        percValue := rec."Premium %" / 100;
        rec."Premium Amount" := rec."Line Amount" * percValue;
        rec."Line Amount" := rec."Line Amount"   rec."Premium Amount";
        CurrPage.Update();
        UpdateAmounts();
        CalcLineAmount();
    end;

    local procedure Update_Premium_Percentage()
    begin
        if rec."Line Amount" <> 0 then begin
            rec."Premium %" := (rec."Premium Amount" * 100) / rec."Line Amount";
            rec."Line Amount" := rec."Line Amount"   rec."Premium Amount";
        end;
        CurrPage.Update();
        UpdateAmounts();
        CalcLineAmount();
    end;

My Subtotal Excl. VAT on the Subform gets updated, however, Total Excl VAT and Total Incl. VAT remains unchanged. Now I can't figure out how solve this.

I have the same question (0)
  • Suggested answer
    keoma Profile Picture
    32,729 on at

    follow docs.microsoft.com/.../devenv-updatepropagation-property

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,690 Super User 2026 Season 1

#2
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,091 Super User 2026 Season 1

#3
YUN ZHU Profile Picture

YUN ZHU 1,047 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans