KPI Templates
Used for adding KPI Templates that the user can chose from.
This codeunit is used as parameter in the event OnPopulateTemplates
published in
Codeunit "QWEEG KPI Template Mgt.". New templates can be added by subscribing to this event.
The filter functions are available for both the table and the page to be able to define different filters for Calculations and Drill Down, and one that adds the same filter to both.
Deprecated
This object is deprecated and should not be used.
Reason: This API is published as "Beta" and can be subject to change without notice, use with caution.
Deprecated since: 23.6
Object Definition
Object Type | Codeunit |
Object ID | 70337435 |
Object Name | QWEEG KPI Templates |
Procedures
Name | Description |
---|---|
AddCoupling(Integer; Integer) | Adds a coupling between a field in the table specified in AddTemplate() and a field in the related table specified in AddRelatedTable() . |
AddDateFormulaFilter(Integer; Enum "QWEEG Date Relative to"; Code[20]) | Adds a Date Formula to the Date Filter for the table and page specified by the AddTemplate() function. |
AddDateFormulaPageFilter(Integer; Enum "QWEEG Date Relative to"; Code[20]) | Adds a Date Formula to the Date Filter for the page specified by the AddTemplate() function. |
AddDateFormulaTableFilter(Integer; Enum "QWEEG Date Relative to"; Code[20]) | Adds a Date Formula to the Date Filter for the table specified by the AddTemplate() function. |
AddDateFormulaVariable(Text[100]; Text[100]; Code[20]) | Registers a Date Formula variable to be prompted to the user. |
AddDateRangeFilter(Integer; Enum "QWEEG Date Relative to"; Code[20]) | Adds a Date Range to the Date Filter for the table and page specified by the AddTemplate() function. |
AddDateRangePageFilter(Integer; Enum "QWEEG Date Relative to"; Code[20]) | Adds a Date Range to the Date Filter for the page specified by the AddTemplate() function. |
AddDateRangeTableFilter(Integer; Enum "QWEEG Date Relative to"; Code[20]) | Adds a Date Range to the Date Filter for the table specified by the AddTemplate() function. |
AddDateRangeVariable(Text[100]; Text[100]; Code[20]) | Registers a Date Range variable to be prompted to the user. |
AddDateRangeVariable(Text[100]; Text[100]; Code[20]; Enum "QWEEG Allowed Date Ranges") | Registers a Date Range variable to be prompted to the user. |
AddFilter(Integer; Text[1000]) | Adds a filter for the table and page specified by the AddTemplate() function. |
AddFilterVariable(Text[100]; Text[100]; Text[100]) | Registers a filter variable to be prompted to the user. |
AddPageFilter(Integer; Text[1000]) | Adds a filter for the page specified by the AddTemplate() function. |
AddPageSystemFilter(Integer; Enum "QWEEG System Filter") | Adds a system filter for the page specified by the AddTemplate() function. |
AddRelatedTable(Integer) | Specifies that filters from a related table should be used when calculating the KPI. |
AddSystemFilter(Integer; Enum "QWEEG System Filter") | Adds a system filter for the table and page specified by the AddTemplate() function. |
AddTableFilter(Integer; Text[1000]) | Adds a filter for the table specified by the AddTemplate() function. |
AddTableSystemFilter(Integer; Enum "QWEEG System Filter") | Adds a system filter for the table specified by the AddTemplate() function. |
AddTemplate(Text[100]; Text[100]; Enum "QWEEG App"; Integer; Enum "QWEEG Adv. KPI Calc. Type"; Integer; Integer) | Adds a KPI Template that can be selected by the user. |
AddTemplate(Text[100]; Text[100]; Enum "QWEEG App"; Integer; Integer) | Adds a KPI Template that can be selected by the user. |
AddTemplate(Text[100]; Text[100]; Guid; Integer; Enum "QWEEG Adv. KPI Calc. Type"; Integer; Integer) | Adds a KPI Template that can be selected by the user. |
AddTemplate(Text[100]; Text[100]; Guid; Integer; Integer) | Adds a KPI Template that can be selected by the user. |
AddTemplate(Text[100]; Text[100]; Integer; Enum "QWEEG Adv. KPI Calc. Type"; Integer; Integer) | Adds a KPI Template that can be selected by the user. |
AddTemplate(Text[100]; Text[100]; Integer; Integer) | Adds a KPI Template that can be selected by the user. |
AddTemplateGroupRelation(Enum "QWEEG Template Group") | Adds the template to a group with the specified name. |
Example
Event Subscriber
Add a event subscriber to be able to call the codeunit "QWEEG KPI Templates" and add templates
[EventSubscriber(ObjectType::Codeunit, Codeunit::"QWEEG KPI Template Mgt.", 'OnPopulateTemplates', '', false, false)]
local procedure PopulateTemplates(var KPITemplates: Codeunit "QWEEG KPI Templates")
begin
[Add your templates here]
end
Add a simple template
The same filter is applied to both the table and the page.
KPITemplates.AddTemplate(NewIncomingDocumentsNameTxt, NewIncomingDocumentsDescriptionTxt, Database::"Incoming Document", Page::"Incoming Documents");
KPITemplates.AddFilter(18, 'New'); // Status
Add a template with Date Range
The user will be prompted to select a Date Range for the variable TimeForward.
The user input will then be used to replace the variable containers ({TimeForward}
) when the
template is created.
KPITemplates.AddTemplate(SoonOverduePurchInvAmtNameTxt, SoonOverduePurchInvAmtDescriptionTxt, Database::"Vendor Ledger Entry", 16, Page::"Vendor Ledger Entries"); // Remaining Amt. (LCY)
KPITemplates.AddTableFilter(5, 'Invoice'); // Document Type
KPITemplates.AddTableFilter(36, 'Yes'); // Open
KPITemplates.AddPageFilter(5, 'Invoice'); // Document Type
KPITemplates.AddPageFilter(36, 'Yes'); // Open
KPITemplates.AddDateRangeTableFilter(37, Enum::"QWEEG Date Relative to"::"Current Day", '{TimeForward}'); // Due Date
KPITemplates.AddDateRangePageFilter(37, Enum::"QWEEG Date Relative to"::"Current Day", '{TimeForward}'); // Due Date
KPITemplates.AddDateRangeVariable('TimeForward', TheDateRangeTxt, 'CD+7D', Enum::"QWEEG Allowed Date Ranges"::"No Empty Date Codes");
Add a template with variables
The user will be prompted to set the values for the variables JournalTemplateName and JournalBatchName. The user input will then be used to replace the variable containers (the variable surrounded by {}) when the template is created.
KPITemplates.AddTemplate(FAGLJnlAmountNameTxt, FAGLJnlAmountDescriptionTxt, Database::"Gen. Journal Line", 16, Page::"Fixed Asset G/L Journal"); // 16 = Amount (LCY)
KPITemplates.AddTableFilter(1, '{JournalTemplateName}'); // Journal Template Name
KPITemplates.AddTableFilter(3, 'G/L Account'); // Account Type
KPITemplates.AddTableFilter(51, '{JournalBatchName}'); // Journal Batch Name
KPITemplates.AddPageFilter(1, '{JournalTemplateName}'); // Journal Template Name
KPITemplates.AddPageFilter(51, '{JournalBatchName}'); // Journal Batch Name
KPITemplates.AddFilterVariable('JournalTemplateName', JournalTemplateNameTxt, JournalTemplateName);
KPITemplates.AddFilterVariable('JournalBatchName', JournalBatchNameTxt, JournalBatchName);
This documentation is generated from Eagle v23.7.170568.0