Extending Caller Card-Factboxes

To extend an existing CTI factbox it with additional information,two page extensions are required: One for the Factbox that is to be extended and another for the Caller Card on which the factbox is to be placed. To display additional information in an existing factbox, you can extend the factbox page. The following example shows a PageExtension for the factbox "SIM_CTI Call-In Sales FB", where a new field for the number of shipping documents (Sales Shipments) is added:

AL
pageextension 50120 "Docu Extending Factbox" extends "SIM_CTI Call-In Sales FB"
{
    layout
    {
        addafter("StrSubstNo('%1',SalesCreditMemoCount)")
        {
            field("Sales Shipment"; GlobalSalesShipmentAmountInteger)
            {
                ApplicationArea = all;
                Caption = '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;
            }
        }
    }
    var
        GlobalSalesShipmentAmountInteger: Integer;

    procedure CalcEntries(ParamCustomerCode: Code[20])
    var
        LocalSalesShipmentHeaderRecord: Record "Sales Shipment Header";
    begin
        LocalSalesShipmentHeaderRecord.Reset();
        LocalSalesShipmentHeaderRecord.setrange("Sell-to Customer No.", ParamCustomerCode);
        GlobalSalesShipmentAmountInteger := LocalSalesShipmentHeaderRecord.Count;
    end;
}
The Page Extension for the Caller Card transfer the necessary data to enable the factbox updates. In the following example, the PageExtension ensures that the factbox is updated with the current customer number:

AL
1
2
3
4
5
6
7
pageextension 50119 "Docu CTI" extends "SIM_CTI Call In Cust. - Sales"
{
    trigger OnOpenPage()
    begin
        CurrPage.SIM_CTISalesFB.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.