Extension methods and financial reports
How a consultant adds methods to a customer's Business Central from a per-tenant extension (PTE) without touching the Plur-e app, and how financial reports run by API.
Quick answer
The Plur-e extension runs Business Central financial reports by name for the app, the Admin Center and AI assistants, and lets a consultant add methods from a per-tenant extension (PTE) without touching the AppSource app. Buying and licences live in the Plur-e Store on the web and in the Admin Center, never in Business Central.
Financial Reports by API
The extension can run a Financial Report of Business Central (version 23 or later) by name. It exposes two methods, ListFinancialReports (name and description) and RunFinancialReport:
| Parameter | Meaning |
|---|---|
ReportName | Required. The financial report. |
From, To | Dates as YYYY-MM-DD. To defaults to the work date and From to the first day of To's month. |
ColumnLayout | Optional. Defaults to the report's own column definition. |
Dimension1Filter, Dimension2Filter, GLBudgetFilter | Optional filters. |
You get the rows (line number, row number, description, bold, indentation) and one value per visible column. The methods require the Business Central Panel module and are used by the MCP tools and by report views of the Capability Studio.
Add methods from a PTE
A customer's own logic belongs in their PTE, not in the Plur-e app. erp/processrequest runs built-in methods first; when no built-in method has the requested name, it looks for a value of the extensible enum "PLU Process Method Ext" with that exact name and runs its implementation of the interface "PLU IProcess Method":
Run(Parameters: JsonToken): Textruns the method and returns the response text, usually JSON.Describe(): JsonObjectdescribes it for the catalogue:name,kind(Read,WriteorPost),descriptionandparameters(name,type,required).
Example, a read method that counts a customer's open sales orders. Use your own prefix and ID range.
enumextension 50100 "ACME Process Method" extends "PLU Process Method Ext"
{
value(50100; ACMEOpenOrdersCount)
{
Caption = 'ACMEOpenOrdersCount', Locked = true;
Implementation = "PLU IProcess Method" = "ACME Open Orders Count";
}
}
codeunit 50100 "ACME Open Orders Count" implements "PLU IProcess Method"
{
procedure Run(Parameters: JsonToken): Text
var
SalesHeader: Record "Sales Header";
ParamsObject: JsonObject;
ParamsArray: JsonArray;
FirstToken: JsonToken;
CustomerToken: JsonToken;
Result: JsonObject;
Output: Text;
begin
if Parameters.IsArray() then begin
ParamsArray := Parameters.AsArray();
ParamsArray.Get(0, FirstToken);
ParamsObject := FirstToken.AsObject();
end else
ParamsObject := Parameters.AsObject();
if not ParamsObject.Get('CustomerNo', CustomerToken) then
Error(CustomerNoRequiredErr);
SalesHeader.SetRange("Document Type", SalesHeader."Document Type"::Order);
SalesHeader.SetRange("Sell-to Customer No.", CustomerToken.AsValue().AsText());
Result.Add('openOrders', SalesHeader.Count());
Result.WriteTo(Output);
exit(Output);
end;
procedure Describe(): JsonObject
var
Description: JsonObject;
ParameterList: JsonArray;
Parameter: JsonObject;
begin
Parameter.Add('name', 'CustomerNo');
Parameter.Add('type', 'Text');
Parameter.Add('required', true);
ParameterList.Add(Parameter);
Description.Add('name', 'ACMEOpenOrdersCount');
Description.Add('kind', 'Read');
Description.Add('description', 'Counts the open sales orders of a customer.');
Description.Add('parameters', ParameterList);
exit(Description);
end;
var
CustomerNoRequiredErr: Label 'The parameter CustomerNo is required.';
}After installing the PTE:
- The name of the enum value is the
ProcessMethodthe API sends. Built-in methods keep priority, so choose a prefixed name. ListProcessMethodslists every extension method with itsDescribe()and the app version. A platform administrator runs Discover methods for the environment, and the new methods enter the catalogue inactive.- A platform administrator activates the ones that should be used. Only active catalogue methods can be used by capabilities and MCP.
Limits
- The Plur-e app is not modified: a PTE can add methods, not change the built-in ones.
- The extension needs your administrator to have activated Plur-e in Business Central; without activation there is nothing to refresh.
Panel roles and permissions
The five default Plur-e panel roles, the permission lines they grant and how to give people access to the Business Central Panel.
Admin Center overview
The Plur-e Admin Center (admincenter.plur-e.com) is where administrators manage environments, subscription, account and mobile users, roles, printers, documents, payments, shipping and the company settings.