Skip to content
Merged
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 @@ -109,11 +109,18 @@ page 6945 "Expense Category Card"

trigger OnQueryClosePage(CloseAction: Action): Boolean
Comment thread
v-rohangarg20 marked this conversation as resolved.
begin
if Rec."Expense Detail Required" = Rec."Expense Detail Required"::Itemize then
CheckShowConfirmationForSubCategories(Rec);
if not IsDeletingCategory then
if Rec."Expense Detail Required" = Rec."Expense Detail Required"::Itemize then
CheckShowConfirmationForSubCategories(Rec);
end;

trigger OnDeleteRecord(): Boolean
begin
IsDeletingCategory := true;
end;

var
IsDeletingCategory: Boolean;
ContinueWithMissingSubcategoryQst: Label 'You have not added any subcategories for expense category %1 where %2 is %3.\\ It will be required to be added before you can use this expense category.\\ Do you want to continue without adding subcategories ?', Comment = '%1 - Expense Category Code, %2 - Field Name "Expense Detail Required", %3 - Expense Detail Required';

local procedure CheckShowConfirmationForSubCategories(ExpenseCategory: Record "Expense Category")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,18 @@ page 6949 "Expense User"

trigger OnDeleteRecord(): Boolean
begin
exit(Rec.ConfirmApproverReassignment());
IsDeletingExpenseUser := Rec.ConfirmApproverReassignment();
exit(IsDeletingExpenseUser);
end;

trigger OnQueryClosePage(CloseAction: Action): Boolean
var
ConfirmManagement: Codeunit "Confirm Management";
begin
if Rec."Employee No." = '' then
if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(CloseWithoutEmployeeNoQst, Rec.FieldCaption("Employee No.")), true) then
exit(false);
if not IsDeletingExpenseUser then
if Rec."Employee No." = '' then
if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(CloseWithoutEmployeeNoQst, Rec.FieldCaption("Employee No.")), true) then
exit(false);
end;

trigger OnOpenPage()
Expand All @@ -260,6 +262,7 @@ page 6949 "Expense User"
var
NoFieldVisible: Boolean;
IsCreateEmployeeVisible: Boolean;
IsDeletingExpenseUser: Boolean;
CloseWithoutEmployeeNoQst: Label '%1 is blank. The expense user will not be linked to an employee.\\Are you sure you want to exit?', Comment = '%1 = Employee No. field caption';

local procedure SetCodeFieldVisible()
Expand Down
Loading