Skip to content

Extending pages with the Barcode Factbox

In this documentation we will create an extension that extends a page in Business Central with the Document Inbound Barcode factbox. The factbox is used to see, manage and create Barcodes created for the record.

There are two ways to do this:

In case of an own page, you can add the code directly to the page. With other page you can create a page extension which will execute the code.

The following requirements must be met:

  • The DMS module must be licensed.
  • The Document Inbound module must be licensed
  • CORE by Simova must be available in the extension as a reference.
  • DMS by Simova must be present in the extension as a reference.
  • Document Inbound by Simova must be present in the extension as a reference.

Code for the extension of a Business Central Page with The the Barcode Return factbox:

AL
pageextension 71667598 "SIM_DMSDI PSInvoiceExt" extends "Posted Sales Invoice" //132
{
    layout
    {
        addafter(SIM_DMSDropZoneFB)
        {
            part(SIM_DMSDIBarcodeReturnFB; "SIM_DMSDI Barcode Return FB")
            {
                ApplicationArea = All;
                Visible = GlobalBarcodeVisibleBoolean;
            }
        }
    }
    var
        GlobalBarcodeVisibleBoolean: Boolean;

    trigger OnAfterGetCurrRecord()
    begin
        CurrPage.SIM_DMSDIBarcodeReturnFB.Page.SetVariant(CurrPage.OBJECTID(false), Rec, Rec."No.");
        GlobalBarcodeVisibleBoolean := CurrPage.SIM_DMSDIBarcodeReturnFB.Page.GetVisible();
    end;
}

This code adds the barcode factbox to the page. This allows the creation of barcode labels and assignment of barcodes to the record, as well as the option to see the status of the barcode entry.