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

Dynamically Set Visibility of Repeater Fields

(0) ShareShare
ReportReport
Posted on by 326

Is it possible to dynamically set the visibility of a repeater field, such as a column in the Sales Lines on a Sales Order? For example, I only want to display the "Action" field column on the Sales Lines if a condition in the Sales Header is met.

I know it's possible to do this dynamically using a Group and a global boolean variable for something in the header. But there is no group property for repeater fields. Is there a way around this?

  • Verified answer
    Binesh Profile Picture
    Binesh 7,885 on at
    RE: Dynamically Set Visibility of Repeater Fields

    Hello,

    You can do it by customization, for reference see the below code.

    pageextension 50103 "Page46 Ext" extends "Sales Order Subform"
    {
        layout
        {
            modify("Location Code")
            {
                Visible = IsLocationVisible;
            }
        }
    
        trigger OnAfterGetRecord()
        begin
            CheckLocationVisibility();
        end;
    
        trigger OnOpenPage()
        begin
            CheckLocationVisibility();
    
        end;
    
        local procedure CheckLocationVisibility()
        begin
            if SalesHeaderG.Get("Document Type", "Document No.") then
                if SalesHeaderG."Location Code" = '' then
                    Clear(IsLocationVisible)
                else
                    IsLocationVisible := true;
        end;
    
        var
            SalesHeaderG: Record "Sales Header";
    
            [InDataSet]
            IsLocationVisible: Boolean;
    }

    Note: When you next/previous the record, it will visible the location code dynamically based on header Location code.

    pastedimage1592422353307v1.png

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans