The pain
Someone exports invoices, pastes them into last week’s file, fixes the pivot and emails it out. The numbers are stale the moment they are sent.
Why it happens
There is no clean, live feed of the data you report on, so people rebuild it by hand.
Before: The Monday ritual
// 1. Open Posted Sales Invoices
// 2. Open in Excel, export
// 3. Paste into last week's file
// 4. Fix the pivot table
// 5. Email it to the team
// Repeat every Monday
After: A read only API page for Power BI
page 50120 "DF Invoice Lines API"
{
PageType = API;
APIPublisher = 'dataflow';
APIGroup = 'reporting';
APIVersion = 'v1.0';
EntityName = 'invoiceLine';
EntitySetName = 'invoiceLines';
SourceTable = "Sales Invoice Line";
ODataKeyFields = SystemId;
Editable = false;
layout { area(Content) { repeater(Lines) {
field(id; Rec.SystemId) { }
field(documentNo; Rec."Document No.") { }
field(itemNo; Rec."No.") { }
field(amount; Rec.Amount) { }
} } }
}
The result
Power BI connects to the API and refreshes on a schedule. The Monday report builds itself.
Tip: Add only the fields you report on. Smaller APIs refresh faster.
Download this teardown as a PDF
Got a Business Central problem like this? Free 30 minute review of your setup. Senior Microsoft certified developers, and you talk to the person writing the code. Contact Dataflow Solutions.
