From 09d1d4758478d686baed9a82e22e4b3f3464b40a Mon Sep 17 00:00:00 2001 From: v-rohangarg20 Date: Thu, 3 Sep 2026 17:06:02 +0530 Subject: [PATCH] Bug 648538: add mileage setup to Expense Agent wizard Add a mileage-rate configuration link below the default mileage unit and warn when closing mileage setup without configured rates. --- .../src/MasterData/Pages/MileageRateSetup.Page.al | 13 +++++++++++++ .../Setup/Pages/ExpenseAgentSetupWizard.Page.al | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/Apps/W1/ExpenseAgent/app/src/MasterData/Pages/MileageRateSetup.Page.al b/src/Apps/W1/ExpenseAgent/app/src/MasterData/Pages/MileageRateSetup.Page.al index 10467f7a50e..71c4db349b5 100644 --- a/src/Apps/W1/ExpenseAgent/app/src/MasterData/Pages/MileageRateSetup.Page.al +++ b/src/Apps/W1/ExpenseAgent/app/src/MasterData/Pages/MileageRateSetup.Page.al @@ -42,4 +42,17 @@ page 7128 "Mileage Rate Setup" } } } + + trigger OnQueryClosePage(CloseAction: Action): Boolean + var + MileageRateSetup: Record "Mileage Rate Setup"; + begin + if not MileageRateSetup.IsEmpty() then + exit(true); + + exit(Confirm(MissingMileageRateSetupQst, true)); + end; + + var + MissingMileageRateSetupQst: Label 'No mileage rates have been configured. The standard mileage rate will be used. Do you want to continue?'; } diff --git a/src/Apps/W1/ExpenseAgent/app/src/Setup/Pages/ExpenseAgentSetupWizard.Page.al b/src/Apps/W1/ExpenseAgent/app/src/Setup/Pages/ExpenseAgentSetupWizard.Page.al index 3b875d97b75..8ca8bb82511 100644 --- a/src/Apps/W1/ExpenseAgent/app/src/Setup/Pages/ExpenseAgentSetupWizard.Page.al +++ b/src/Apps/W1/ExpenseAgent/app/src/Setup/Pages/ExpenseAgentSetupWizard.Page.al @@ -710,6 +710,19 @@ page 6991 "Expense Agent Setup Wizard" ConfigUpdated(); end; } + field(MileageRateSetupLink; MileageRateSetupLinkTxt) + { + ShowCaption = false; + Editable = false; + ToolTip = 'Specifies where to configure mileage rates by vehicle type.'; + + trigger OnDrillDown() + var + MileageRateSetup: Page "Mileage Rate Setup"; + begin + MileageRateSetup.RunModal(); + end; + } } group(ProjectGroup) { @@ -944,6 +957,7 @@ page 6991 "Expense Agent Setup Wizard" RulesAppliedLinkTxt: Label 'View management rules including new defaults'; NoSeriesLinkTxt: Label 'Preview the default number series that will be added'; NoSeriesAppliedLinkTxt: Label 'View number series including new defaults'; + MileageRateSetupLinkTxt: Label 'Configure mileage rates by vehicle type'; ExpenseDashboardLinkTxt: Label 'Go to Expense app (opens in new window)'; ExpenseDashboardUrlOnPremTxt: Label 'http://localhost:5173/', Locked = true; ExpenseDashboardUrlProdTxt: Label 'https://go.microsoft.com/fwlink/?LinkId=2365219', Locked = true;