web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Control Add-in Only executing once

(1) ShareShare
ReportReport
Posted on by 13
Hello Community,
 
I created a control add-in which increases the font size on a custom page (image at bottom). The issue I am having is it only works one time and the next time I open the page the font returns to the base font. I am unsure how to alter my code so the javascript runs each time I open it. Let me know if you can offer some assistance. Source below. 
 
(controladdin)
controladdin JavacriptAccess{    Scripts = 'script.js';    StartupScript = 'startup.js';    MaximumHeight = 1;    MinimumHeight = 1;    MaximumWidth = 1;    MinimumWidth = 1;    RequestedHeight = 1;    RequestedWidth = 1;event ControlReady();procedure clickanything();}
 
(script.js)
function gettext(){    var FieldA= window.parent.document.getElementById('b9fee')        FieldA.style.setProperty('font-size','40px','important');}
 
(startup.js)
 
Microsoft.Dynamics.NAV.InvokeExtensibilityMethod('ControlReady',[]);
 
 
(Page)
 
page 62800 PoReportPage{    Caption = 'Purchasing Reports';    PageType = Card;    ApplicationArea = All;    Editable = false;    SaveValues = false;    UsageCategory = Administration;    layout    {        area(Content)        {            grid(grid1)            {                GridLayout = Columns;            }            field(A; 'Open PO Report')            {                ApplicationArea = All;                Editable = false;                ShowCaption = false;                Style = StrongAccent;                StyleExpr = true;                trigger OnDrillDown()                begin                    ;                    page.Run(62802);                end;            }            usercontrol(javascriptAccess;JavacriptAccess)            {                ApplicationArea = all;                trigger ControlReady()                begin                    CurrPage.javascriptAccess.gettext();                end;            }        }    }    var        A: Label 'Open PO Report';}
 
 
 
 
 
 
 
I have the same question (0)
  • jack Profile Picture
    13 on at
    (controladdin)
     
    controladdin JavacriptAccess
    {
        Scripts = 'script.js';
        StartupScript = 'startup.js';
        MaximumHeight = 1;
        MinimumHeight = 1;
        MaximumWidth = 1;
        MinimumWidth = 1;
        RequestedHeight = 1;
        RequestedWidth = 1;
    event ControlReady();
    procedure gettext();
    }
     
     
     
    page 62800 PoReportPage
    {
        Caption = 'Purchasing Reports';
        PageType = Card;
        ApplicationArea = All;
        Editable = false;
        SaveValues = false;
        UsageCategory = Administration;
        layout
        {
            area(Content)
            {
                grid(grid1)
                {
                    GridLayout = Columns;
                }
                field(A; 'Open PO Report')
                {
                    ApplicationArea = All;
                    Editable = false;
                    ShowCaption = false;
                    Style = StrongAccent;
                    StyleExpr = true;
                    trigger OnDrillDown()
                    begin
                        ;
                        page.Run(62802);
                    end;
                }
                usercontrol(javascriptAccess;JavacriptAccess)
                {
                    ApplicationArea = all;
                    trigger ControlReady()
                    begin
                        CurrPage.javascriptAccess.gettext();
                    end;
                }
            }
        }
        var
            A: Label 'Open PO Report';
    }
     
     
    (script.js)
     
    function gettext()
    {
        var FieldA= window.parent.document.getElementById('b9fee')
        
        FieldA.style.setProperty('font-size','40px','important');
    }
     
     
    (startup.js)
     
    Microsoft.Dynamics.NAV.InvokeExtensibilityMethod('ControlReady',[]);
     
     
    (page)
     
    page 62800 PoReportPage
    {
        Caption = 'Purchasing Reports';
        PageType = Card;
        ApplicationArea = All;
        Editable = false;
        SaveValues = false;
        UsageCategory = Administration;
        layout
        {
            area(Content)
            {
                grid(grid1)
                {
                    GridLayout = Columns;
                }
                field(A; 'Open PO Report')
                {
                    ApplicationArea = All;
                    Editable = false;
                    ShowCaption = false;
                    Style = StrongAccent;
                    StyleExpr = true;
                    trigger OnDrillDown()
                    begin
                        ;
                        page.Run(62802);
                    end;
                }
                usercontrol(javascriptAccess;JavacriptAccess)
                {
                    ApplicationArea = all;
                    trigger ControlReady()
                    begin
                        CurrPage.javascriptAccess.gettext();
                    end;
                }
            }
        }
        var
            A: Label 'Open PO Report';
    }
     
     
     
     
  • David Tailor Profile Picture
    822 on at
    Hi Jack,
     
    i write the same code you have posted. however i didn't have the same result: "Open PO Report" is not big even for first time.
    is there anything missing?
     
    Regards,
    David

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,850 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,045 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans