Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,29 @@ codeunit 5223 "Create Acc. Schedule Name"
var
ContosoAccountSchedule: Codeunit "Contoso Account Schedule";
begin
ContosoAccountSchedule.InsertAccScheduleName(CashCycle(), CashCycleDataLbl, '');
ContosoAccountSchedule.InsertAccScheduleName(CashFlow(), CashFlowDataLbl, '');
ContosoAccountSchedule.InsertAccScheduleName(IncomeExpense(), IncomeExpenseDataLbl, '');
ContosoAccountSchedule.InsertAccScheduleName(ReducedTrialBalance(), ReducedTrialBalanceDataLbl, '');
ContosoAccountSchedule.InsertAccScheduleName(CashCycle(), CashCycleDataLbl, '', CashCycleInternalDescLbl);
ContosoAccountSchedule.InsertAccScheduleName(CashFlow(), CashFlowDataLbl, '', CashFlowInternalDescLbl);
ContosoAccountSchedule.InsertAccScheduleName(IncomeExpense(), IncomeExpenseDataLbl, '', IncomeExpenseInternalDescLbl);
ContosoAccountSchedule.InsertAccScheduleName(ReducedTrialBalance(), ReducedTrialBalanceDataLbl, '', ReducedTrialBalanceInternalDescLbl);
end;

procedure UpdateInternalDescriptions()
var
ContosoAccountSchedule: Codeunit "Contoso Account Schedule";
BalanceSheetCodeTok: Label 'M-BALANCE', MaxLength = 10;
IncomeStmdCodeTok: Label 'M-INCOME', MaxLength = 10;
CashFlowCodeTok: Label 'M-CASHFLOW', MaxLength = 10;
RetainedEarnCodeTok: Label 'M-RETAIND', MaxLength = 10;
InternalDescriptionLbl: Label 'Generated from the G/L Account Categories page.', MaxLength = 250;
begin
ContosoAccountSchedule.UpdateAccScheduleName(CashCycle(), CashCycleInternalDescLbl);
ContosoAccountSchedule.UpdateAccScheduleName(CashFlow(), CashFlowInternalDescLbl);
ContosoAccountSchedule.UpdateAccScheduleName(IncomeExpense(), IncomeExpenseInternalDescLbl);
ContosoAccountSchedule.UpdateAccScheduleName(ReducedTrialBalance(), ReducedTrialBalanceInternalDescLbl);
ContosoAccountSchedule.UpdateAccScheduleName(BalanceSheetCodeTok, InternalDescriptionLbl);
ContosoAccountSchedule.UpdateAccScheduleName(IncomeStmdCodeTok, InternalDescriptionLbl);
ContosoAccountSchedule.UpdateAccScheduleName(CashFlowCodeTok, InternalDescriptionLbl);
ContosoAccountSchedule.UpdateAccScheduleName(RetainedEarnCodeTok, InternalDescriptionLbl);
end;

procedure AccountCategoriesOverview(): Code[10]
Expand Down Expand Up @@ -129,5 +148,9 @@ codeunit 5223 "Create Acc. Schedule Name"
CashFlowDataLbl: Label 'Data for Cash Flow Chart', MaxLength = 80;
IncomeExpenseDataLbl: Label 'Data for Income & Expense Chart', MaxLength = 80;
ReducedTrialBalanceDataLbl: Label 'Data for Reduced Trial Balance Info Part', MaxLength = 80;
CashCycleInternalDescLbl: Label 'Used for generating data for the Cash Cycle Chart.', MaxLength = 250;
CashFlowInternalDescLbl: Label 'Used for generating data for the Cash Flow Chart.', MaxLength = 250;
IncomeExpenseInternalDescLbl: Label 'Used for generating data for the Income & Expense Chart.', MaxLength = 250;
ReducedTrialBalanceInternalDescLbl: Label 'Used for generating data for the Reduced Trial Balance Info Part.', MaxLength = 250;
RevenuesLbl: Label 'Revenues', MaxLength = 80;
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ codeunit 5239 "Contoso Account Schedule"
end;

procedure InsertAccScheduleName(Name: Code[10]; Description: Text[80]; AnalysisViewName: Code[10])
begin
InsertAccScheduleName(Name, Description, AnalysisViewName, '');
end;

procedure InsertAccScheduleName(Name: Code[10]; Description: Text[80]; AnalysisViewName: Code[10]; InternalDescription: Text[250])
var
AccScheduleName: Record "Acc. Schedule Name";
Exists: Boolean;
Expand All @@ -116,6 +121,9 @@ codeunit 5239 "Contoso Account Schedule"
AccScheduleName.Validate(Name, Name);
AccScheduleName.Validate(Description, Description);
AccScheduleName.Validate("Analysis View Name", AnalysisViewName);
if InternalDescription <> '' then begin
AccScheduleName.Validate("Internal Description", InternalDescription);
end;

if Exists then
AccScheduleName.Modify(true)
Expand Down Expand Up @@ -279,4 +287,16 @@ codeunit 5239 "Contoso Account Schedule"

ChartDefinition.Insert(true);
end;

procedure UpdateAccScheduleName(Name: Code[10]; InternalDescription: Text[250])
var
AccScheduleName: Record "Acc. Schedule Name";
begin
if AccScheduleName.Get(Name) then begin
if AccScheduleName."Internal Description" = '' then begin
AccScheduleName.Validate("Internal Description", InternalDescription);
AccScheduleName.Modify(true);
end;
end;
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace Microsoft.DemoTool;

using Microsoft.DemoData.Finance;
using System.Telemetry;

page 5194 "Contoso Demo Tool"
Expand Down Expand Up @@ -86,6 +87,27 @@ page 5194 "Contoso Demo Tool"
FeatureTelemetry.LogUsage('0000L01', ContosoCoffeeDemoDatasetFeatureNameTok, 'Contoso demo Data generated for Setup');
end;
}
action(UpdateInternalDescriptions)
{
Caption = 'Update Internal Descriptions';
ToolTip = 'Update internal definitions for financial report defintions in the existing demo company.';
Image = Create;

trigger OnAction()
var
CreateColumnLayoutName: Codeunit "Create Column Layout Name";
CreateAccScheduleName: Codeunit "Create Acc. Schedule Name";
UpdateNewColumnDefinitionsMsg: Label 'Would you like to update internal descriptions for financial report definitions in the existing demo company?';
begin
Rec.TestField(Module, Rec.Module::Finance);
Rec.TestField("Data Level", Rec."Data Level"::All);

if not Confirm(UpdateNewColumnDefinitionsMsg) then
exit;

CreateAccScheduleName.UpdateInternalDescriptions();
end;
}
}
action(Configuration)
{
Expand Down Expand Up @@ -115,6 +137,7 @@ page 5194 "Contoso Demo Tool"
}

actionref(Configuration_Promoted; Configuration) { }
actionref(UpdateInternalDescriptions_Promoted; UpdateInternalDescriptions) { }
}
}

Expand Down
Loading