Can we Open HTML page using AL Code Business central

Hi All,

I have created one HTML Page for explaining some Document information. and also create one Page using AL [ie. Posting setup]. in that, I want to create a button to display HTML Page.

can we open the HTML page?

Thanks in Advanced.

use a control addin!
from JS you could import some HTML like so:
Control Addin Object - Business Central | Microsoft Docs

Thanks for your reply. I have used control Add. But I am unable to display Image in Control Add-in Page. But it displays HTML Tag. ie

I have done Control Add-in as follows.

  1. Demo Page to display Control Add-in [DempPage.al]

  2. Create user Control controladdin page AL [UserControal.al]

  3. Then last two JS Script startup and script [startup.js, script.js]

Could you help that below code where I am wrong due to the image not display.

page 50147 "Demo Page"
{
    Caption = 'Demo Page';
    layout
    {
        area(Content)
        {
            usercontrol(html; HTML)
            {
                ApplicationArea = all;
                trigger ControlReady()
                begin
                    CurrPage.html.Render('<html><body><h1>The img element</h1><img src="../img/img_girl.jpg" alt="Girl in a jacket" width="100" height="100"></body></html>');
                end;
            }
        }
    }
}

/*User Contraol.al*/

controladdin HTML
{
    /*  RequestedHeight = 300;
     MinimumHeight = 300;
     MaximumHeight = 300;
     RequestedWidth = 700;
     MinimumWidth = 700;
     MaximumWidth = 700; */
    VerticalStretch = true;
    VerticalShrink = true;
    HorizontalStretch = true;
    HorizontalShrink = true;
    Scripts = 'script.js';

    StartupScript = 'startup.js';

    event ControlReady();

    procedure Render(HTML: Text);
}

/* script.js */

function Render(html)
{
    HTMLContainer.insertAdjacentHTML('beforeend',html);
}

/* startup.js */
HTMLContainer = document.getElementById("controlAddIn");
Microsoft.Dynamics.NAV.InvokeExtensibilityMethod("ControlReady",[]);

in order to get the images you need to reference that in the properties of the control addin object (Images Property - Business Central | Microsoft Docs)
and then you must get them by using this GetImageResource Method - Business Central | Microsoft Docs