Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Visible in subpart with ControlAddin Not hidding

(0) ShareShare
ReportReport
Posted on by 288

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
        culTCNFuncionesGDC: Codeunit TCNFuncionesGDC;
    begin
        xGdvVisible := culTCNFuncionesGDC.Tabla2GdvF(Rec);
    end;

    var
        [InDataSet]
        xGdvVisible: Boolean;
}
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(Descripcion; Rec.Descripcion)
                {
                    ApplicationArea = All;
                    Caption = 'Descripción';
                    StyleExpr = xEstilo;
                }
                field(Fichero; Rec.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(UserAlta; Rec.UserAlta)
                {
                    ApplicationArea = All;
                    ToolTip = 'Especifica el usuario que ha creado el registro';
                }
                field(Alta; Rec.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
  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: Visible in subpart with ControlAddin Not hidding

    Hello  

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    I will open this up to the community in case they have something to add.

    Thank you.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans