Skip to content

Commit 612e878

Browse files
tuan-nguyen-fenwickTuan Nguyen
andauthored
Add "Sales by Projects" embedded page (#5424)
Adding "Sales by Projects" embedded page to the Power BI Reports BC app. Fixes #5423 Fixes [AB#612193](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/612193) --------- Co-authored-by: Tuan Nguyen <tuan.nguyen@fenwick.com.au>
1 parent 3b15b25 commit 612e878

3 files changed

Lines changed: 75 additions & 2 deletions

File tree

src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/OrderProcessorRoleCenter.PageExt.al

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,15 @@ pageextension 36954 "Order Processor Role Center" extends "Order Processor Role
135135
RunObject = page "Sales Forecasting";
136136
Tooltip = 'Open the Power BI Report that predicts your sales trends, including forecasting of sales metrics across item, customer, document type and salespeople.';
137137
}
138+
action("Sales by Projects (Power BI)")
139+
{
140+
ApplicationArea = Basic, Suite;
141+
Caption = 'Sales by Projects (Power BI)';
142+
Image = "PowerBI";
143+
RunObject = page "Sales by Projects";
144+
Tooltip = 'Open the Power BI Report that breaks down sales performance by project, including sales metrics across customer, item, resources and general ledger accounts.';
145+
}
138146
}
139147
}
140148
}
141-
}
142-
149+
}

src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/SalesMarketingManagerRC.PageExt.al

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@ pageextension 36960 "Sales & Marketing Manager RC" extends "Sales & Marketing Ma
175175
RunObject = page "Sales Forecasting";
176176
Tooltip = 'Open the Power BI Report that predicts your sales trends, including forecasting of sales metrics across item, customer, document type and salespeople.';
177177
}
178+
action("Sales by Projects (Power BI)")
179+
{
180+
ApplicationArea = Basic, Suite;
181+
Caption = 'Sales by Projects (Power BI)';
182+
Image = "PowerBI";
183+
RunObject = page "Sales by Projects";
184+
Tooltip = 'Open the Power BI Report that breaks down sales performance by project, including sales metrics across customer, item, resources and general ledger accounts.';
185+
}
178186
}
179187
}
180188
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// ------------------------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
// Licensed under the MIT License. See License.txt in the project root for license information.
4+
// ------------------------------------------------------------------------------------------------
5+
namespace Microsoft.PowerBIReports;
6+
7+
using System.Integration.PowerBI;
8+
9+
page 37119 "Sales by Projects"
10+
{
11+
UsageCategory = ReportsAndAnalysis;
12+
ApplicationArea = All;
13+
PageType = UserControlHost;
14+
Caption = 'Sales by Projects';
15+
AboutTitle = 'About Sales by Projects';
16+
AboutText = 'The Sales by Projects report breaks down sales performance by project, highlighting metrics such as sales amount and sales quantity. This report provides key insights into the customers, items, general ledger accounts and resources driving project sales and contributing to revenue.';
17+
18+
layout
19+
{
20+
area(Content)
21+
{
22+
usercontrol(PowerBIAddin; PowerBIManagement)
23+
{
24+
ApplicationArea = All;
25+
26+
trigger ControlAddInReady()
27+
begin
28+
SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageLbl);
29+
end;
30+
31+
trigger ReportLoaded(ReportFilters: Text; ActivePageName: Text; ActivePageFilters: Text; CorrelationId: Text)
32+
begin
33+
SetupHelper.LogReportLoaded(CorrelationId);
34+
end;
35+
36+
trigger ErrorOccurred(Operation: Text; ErrorText: Text)
37+
begin
38+
SetupHelper.LogError(Operation, ErrorText);
39+
SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
40+
end;
41+
}
42+
}
43+
}
44+
45+
var
46+
SetupHelper: Codeunit "Power BI Report Setup";
47+
ReportId: Guid;
48+
ReportPageLbl: Label '3f3a8251c4943f8c8fb2', Locked = true;
49+
50+
trigger OnOpenPage()
51+
var
52+
PowerBIReportsSetup: Record "PowerBI Reports Setup";
53+
begin
54+
SetupHelper.EnsureUserAcceptedPowerBITerms();
55+
ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
56+
end;
57+
}
58+

0 commit comments

Comments
 (0)