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...
Answered

Hide Dimension Value Columns for specific Dimension Code

(4) ShareShare
ReportReport
Posted on by 4,095
I am adding following logic in the Dimension Values Page so that the columns "Name", "Dimension Value Type" and "Totaling" are invisible only for "DEPARTMENT" Dimension Code. It works as expected for "Dimension Value Type" and "Totaling" columns but it does not work for "Name" Column, even though the logic is similar. The "Name" Column also becomes invisible in other Dimension Code Values. Is there built-in restriction in BC for "Name" Column? How can I accomplish the desired result? Thank you.
 
pageextension 50100 DimensionValuesExt extends "Dimension Values"
{
    layout
    {
        modify(Totaling)
        {
            Visible = Visibleflag;
        }
        modify("Dimension Value Type")
        {
            Visible = Visibleflag;
        }
        modify(Name)
        {
            Visible = Visibleflag;
        }
    }
 
    var
        Visibleflag: Boolean;
 
    trigger OnOpenPage()
    begin
        if Rec."Dimension Code" = 'DEPARTMENT' then
            Visibleflag := false
        else
            Visibleflag := true;
    end;
}
 
I have the same question (0)
  • Suggested answer
    Pallavi Phade Profile Picture
    5,742 Super User 2026 Season 1 on at
    Namaste @DinB
     
     
    Can you re-write the code in this Way. Thinking aloud . Can you just introduce new variable "NameVisible" and re- write code and see . 
     
    Or 
     
    Write as Below Code
     
    ==========
     
    visibleflag = True ;
    if rec."Dimension Code" = 'Department' then 
    visibleflag = false ; 
     
    ===========
     
    or 
     
    Use Trigger - onInit()
     
     
     
    Kindly let me know 
     
    Warm Regards
    Pallavi Phade
    www.linkedin.com/in/pallaviphade131116
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    23,136 Super User 2026 Season 1 on at
    There is no direct restriction on the Name field, but in this standard page Name is used by IndentationControls, so it acts differently from normal fields.
  • Verified answer
    Khushbu Rajvi. Profile Picture
    23,136 Super User 2026 Season 1 on at
    Try changing the indentation control from Name to Code in your page extension, then hide Name.
    pageextension 50100 DimensionValuesExt extends "Dimension Values"
    {
        layout
        {
            modify(Control1)
            {
                IndentationControls = Code;
            }
            modify(Name)
            {
                Visible = ShowColumns;
            }
            modify("Dimension Value Type")
            {
                Visible = ShowColumns;
            }
            modify(Totaling)
            {
                Visible = ShowColumns;
            }
        }
        var
            ShowColumns: Boolean;
        trigger OnAfterGetRecord()
        begin
            SetColumnVisibility();
        end;
        trigger OnAfterGetCurrRecord()
        begin
            SetColumnVisibility();
        end;
        local procedure SetColumnVisibility()
        begin
            ShowColumns := Rec."Dimension Code" <> 'DEPARTMENT';
        end;
    }
     
     
  • Suggested answer
    Grigorios Mavrogeorgis Profile Picture
    2,868 Super User 2026 Season 1 on at

    Hi, here is what I think is happening.
    That SALES INV series in your screenshot has only Manual Nos ticked and no Starting No or Ending No filled, so it has nothing to give. Preview posting still needs to grab a number for the posted Sales Invoice Header, and with no series numbers it builds that *** placeholder, then can not find the record, that is the error you see.


    Check Sales & Receivables Setup, the field for the posting series (Posted Invoice Nos.). As far as I know that one should point to a series with Default Nos. on and a real Starting No., not a manual only series. The manual series is fine for the document No. itself, but the posted one need automatic numbering.


    Also the *** prefix in preview I seen behave a bit funny in some versions, so test on a real post after you fix the series. Which version you on?
    Hope this help. 

    Glad to help - follow up if anything is unclear.  
    â–º  If this solved it, marking it verified helps others too.      
    Regards,
    Grigorios Mavrogeorgis
    Business Central Consultant & AL Developer

    Work: Gmsoft Limited
    Blog:  insidebusinesscentral
    LinkedIn: linkedin.com/in/gregorymavrogeorgis

     

  • Suggested answer
    YUN ZHU Profile Picture
    102,590 Super User 2026 Season 1 on at
    Hi, hope the following can give you some hints
    How to show or hide subform fields based on a value in the main page
     
    Thanks.
    ZHU
  • Suggested answer
    OussamaSabbouh Profile Picture
    18,486 Super User 2026 Season 1 on at
    Hello,
    I don’t think there is a special built-in restriction on the Name column; the issue is more likely because you are checking Rec."Dimension Code" in OnOpenPage(), while the page is opened with a filter on Dimension Code, and the current Rec value is not always reliable at that moment. Try basing the visibility on the page filter instead, for example: Visibleflag := Rec.GetFilter("Dimension Code") <> 'DEPARTMENT'; or better handle the range with GetRangeMin() if the filter is fixed. Also note that Visible is page/control-level, not row-level, so it hides the column for the opened page instance, not per record. Example: trigger OnOpenPage() begin Visibleflag := Rec.GetFilter("Dimension Code") <> 'DEPARTMENT'; end; Microsoft confirms that dynamic visibility can be controlled by a global Boolean variable and changed on page open.
    Regards,
    Oussama Sabbouh

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 Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 580 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 462 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 272 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans