How to Embed Widgets in your Business Central FastTab Using AL Code

Published: Sep 01, 2023

How to Embed Widgets in your Business Central FastTab Using AL Code

Published: Sep 01, 2023

With the use of a Popdock widget you can integrate a Popdock list or multiple lists directly onto your Business Central FastTab. Below is an example of how to use AL code and Control Add-Ins to embed Popdock on the Customer Card.

You will need to create a Popdock widget prior to following these steps because you will need the widget URL.  Click here to learn how to create a Popdock widget.

You can download final code of this example here.

6307d9d470b36120f1758c11 FastTab

Add Popdock Dependencies

The Popdock for Dynamics 365 Business Central extension from AppSource already contains the Control Add-in you will be using so you can just add a dependency to the existing extension.

In your AL project add the below dependency to your app.json file.

  "dependencies": [
    {
      "id": "f58a05f1-7501-400f-ac28-bc3294e1619a",
      "name": "Popdock for Dynamics 365 Business Central",
      "version": "1.0.0.0",
      "publisher": "eOne Solutions"
    }
  ],

Add the FactBox to the page

Add a pageextension object to your desired card page.

The extension will use an OnAfterGetCurrRecord() trigger to pull the details of the current record so they can be passed as filters to the IFrame.

Next, you will add a new group on the page that will contain the custom FastTab.

// Replace https://widget-weu.popdock.com/embed/494647e3-0ee0-75ca-fb96-feb7ef200602 with your widget id
pageextension 50100 PopdockFastTab extends "Customer Card"
{
    layout
    {
        addlast(Content)
        {
            Group("Customer Entries")
            {
                usercontrol(PopdockFastTab0; eOnePopdockFastTab)
                {
                    ApplicationArea = All;
                }
            }
        }
    }
    trigger OnAfterGetCurrRecord()
    var
        Url0: Text;
        Session: SessionSettings;
    begin
        if GuiAllowed then begin
            Session.Init();
            Url0 := 'https://widget-weu.popdock.com/embed/494647e3-0ee0-75ca-fb96-feb7ef200602?theme=dynamics_bc&locale=' + FORMAT(Session.LocaleId) + '&companyName=' + COMPANYNAME + '&No.=' + rec."No.";
            CurrPage.PopdockFastTab0.CreateUrl(Url0);
        end;
    end;
}

Questions regarding embedding widgets on a FastTab in Business Central using AL code? Contact support@eonesolutions.com.

Content
Add Popdock Dependencies Add the FactBox to the page

Feeling stuck? Get the support and guidance you need to help you power through any data challenge

Reset Filters