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

Visible in subpart with ControlAddin not working properly

(0) ShareShare
ReportReport
Posted on by 293

Good morning all.

I have a page this page extension:

pageextension 7077200 "TCNItemListExtGDC" extends "Item List"
{
    layout
    {
        addlast(FactBoxes)
        {
            part(TCNDocsAdjuntosGDC; TCNFactBoxDocAdjGDC)
            {
                ApplicationArea = all;
                Caption = 'Documentos adjuntos';
                Visible = xGdvVisible;
            }
            part(TCNDropFicheroGDC; TCNDropFicherosCOM)
            {
                ApplicationArea = All;
                Visible = xGdvVisible;
            }
        }
    }

    trigger OnAfterGetCurrRecord()
    var
        culTCNFuncionesGDCCodeunit TCNFuncionesGDC;
    begin
        xGdvVisible := culTCNFuncionesGDC.Tabla2GdvF(Rec);
    end;

    var
        [InDataSet]
        xGdvVisibleBoolean;
}
The line: part(TCNDocsAdjuntosGDC; TCNFactBoxDocAdjGDC) wich is a "normal" listpart:
page 7077202 "TCNFactBoxDocAdjGDC"
{
    Caption = 'Documentos adjuntos';
    Editable = false;
    LinksAllowed = false;
    PageType = ListPart;
    ShowFilter = false;
    SourceTable = TCNDocsAdjuntadosGDC;
    UsageCategory = None;
    layout
    {
        area(content)
        {
            repeater(General)
            {
                field(DescripcionRec.Descripcion)
                {
                    ApplicationArea = All;
                    Caption = 'Descripción';
                    StyleExpr = xEstilo;
                }
                field(FicheroRec.Fichero)
                {
                    ApplicationArea = All;
                    Caption = 'Fichero';
                    DrillDown = true;
                    StyleExpr = xEstilo;
                    trigger OnDrillDown()
                    begin
                        AbrirFicheroF();
                    end;
                }
                field("Document Type"Rec."Document Type")
                {
                    ApplicationArea = All;
                    ToolTip = 'Specifies the value of the Document Type field.';
                }
                field("Due Date"Rec."Due Date")
                {
                    ToolTip = 'Specifies the value of the Due Date field.';
                    ApplicationArea = All;
                }
                field(UserAltaRec.UserAlta)
                {
                    ApplicationArea = All;
                    ToolTip = 'Especifica el usuario que ha creado el registro';
                }
                field(AltaRec.Alta)
                {
                    ApplicationArea = All;
                    ToolTip = 'Indica el momento (Fecha y hora) en la que se ha creado el registro';
                }
            }
        }
    }
I am able ro hide or show depending on the variable xGdvVisible in the page extension. Namely, it works as I want and as expected. 
But the second part:  part(TCNDropFicheroGDC; TCNDropFicherosCOM) wich instead of fields, has a control adding:
    Caption = 'Zona de carga de ficheros';
    PageType = CardPart;
    UsageCategory = None;
    layout
    {
        area(content)
        {
            usercontrol(PictureViewer; "Microsoft.Dynamics.Nav.Client.WebPageViewer")
            {
                ApplicationArea = all;
                Visible = not xOcultar;
                trigger ControlAddInReady(callbackUrl: Text)
                begin
                    CurrPage.PictureViewer.SetContent(PaginaHtmlF(xTextoDrop, xColor), ScriptF());
                end;

                trigger Callback(data: Text)
                begin
                    OnDropF(data, xDatosPasados);
                end;
            }
        }
    }
This one, does no hide/show with the same value as the first one, in the visible property. As you can see in the page extension, the variable  xGdvVisibleis declaerd as [InDataSet] in the list page.
I think wether it is a limitation in BC or a bug.
Could you please help me?
Thank you ever so much
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    101,723 Super User 2026 Season 1 on at

    Hi, I'm not sure if this can help you, according to my previous tests, the usercontrol part, even if it is hidden, will occupy a part of the page, although it does not display any value.
    You can directly modify Visible to false to try, I suspect the result will be the same.
    part(TCNDropFicheroGDC; TCNDropFicherosCOM)
    {
    ApplicationArea = All;
    Visible = false;
    }

    Hope this helps.

    Thanks.

    ZHU

  • JJMc Profile Picture
    293 on at

    Hi Yun.

    Firstly, I would like to thank you for your answer.

    Secondly,I tries what you say and it does not even woks:

    part(TCNDropFicheroGDC; TCNDropFicherosCOM)
    {
    ApplicationArea = All;
    Visible = false;
    }

    When opening the page, I can see the subpart

    Thank you again for your answer.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,334 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,717 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,470

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans