web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 291

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
    93,994 Super User 2025 Season 2 on at
    RE: Visible in subpart with ControlAddin not working properly

    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
    291 on at
    RE: Visible in subpart with ControlAddin not working properly

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,267

#2
Sumit Singh Profile Picture

Sumit Singh 2,098

#3
YUN ZHU Profile Picture

YUN ZHU 1,766 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans