Creating personalised Caller Card factboxes

Individual factboxes for caller cards can be created in AL (Application Language). To create a customised factbox, start by creating a new factbox page. Alternatively, Alternatively, the following template can be used and customised to meet specific requirements. The next example demonstrates how to create a Factbox page named "CTI Documentation Factbox" that refers to the "Sales Shipment Header" table:

AL
page 50104 "My New Factbox"
{
    ApplicationArea = All;
    Caption = 'My New Factbox';
    PageType = Cardpart;
    SourceTable = "Sales Shipment Header";

    layout
    {
        area(content)
        {
            group(General)
            {
                Caption = 'General';

                field("ItemNo.";         GlobalSalesShipmentAmountInteger)
                {
                    Caption = 'Posted Sales Shipments';
                    ToolTip = 'Here you can see the Posted Sales Shipments Entries for the Current Customer';
                    trigger OnDrillDown()
                    var
                        LocalPostedSalesShipmentsPage: Page "Posted Sales Shipments";
                    begin
                        LocalPostedSalesShipmentsPage.Run();
                    end;
                }
            }
        }
    }
    procedure CalcEntries(ParamCustomerCode: Code[20])
    var
        LocalSalesShipmentHeaderRecord: Record "Sales Shipment Header";
    begin
        Rec.Reset();
        Rec.setrange("Sell-to Customer No.", ParamCustomerCode);
        GlobalSalesShipmentAmountInteger := Rec.Count;
    end;

    var
        GlobalSalesShipmentAmountInteger: Integer;
}

This factbox displays the number of posted shipping documents ("Posted Sales Shipments") for the current customer. The CalcEntries procedure is triggered when the Caller Card is opened ( using the OnOpenPage trigger ) and counts the entries in the "Sales Shipment Header" table. It is important to configure the field labels and tooltips according to specific requirements. Once the factbox is defined, it can be integrated into an existing caller card. In the example, the factbox is integrated into the caller card "CTI Call In Customer - Sales".

AL
pageextension 50119 "Docu CTI" extends "SIM_CTI Call In Cust. - Sales"
{
    layout
    {
        addafter(SIM_CTISalesFB)
        {
            part(NewFactbox; "My New Factbox")
            {
                ApplicationArea = all;
            }
        }
    }
    trigger OnOpenPage()
    begin
        CurrPage.NewFactbox.Page.CalcEntries(Rec."No.");
    end;
}
The "CTI Documentation Factbox" will now be placed below the existing "Sales Information" factbox on the "CTI Call In Customer - Sales" Caller Card and provides additional information about the customer's shipping history directly on the Caller Card.