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:
page50104"MyNewFactbox"{ 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; }}}}procedureCalcEntries(ParamCustomerCode:Code[20])varLocalSalesShipmentHeaderRecord:Record"SalesShipmentHeader";beginRec.Reset();Rec.setrange("Sell-toCustomerNo.",ParamCustomerCode);GlobalSalesShipmentAmountInteger:=Rec.Count;end;varGlobalSalesShipmentAmountInteger: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".
pageextension50119"DocuCTI"extends"SIM_CTICallInCust.-Sales"{ layout { addafter(SIM_CTISalesFB) { part(NewFactbox; "My New Factbox") { ApplicationArea = all; }}}triggerOnOpenPage()beginCurrPage.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.