Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
d331712
Repair and re-enable Expense Agent permission and posted-history tests
t-prda Sep 21, 2026
eb3bf74
Repair API currency fixtures and run Spend Request coverage as unit t…
t-prda Sep 21, 2026
ce3e12a
Keep BCApps HTTP API tests excluded pending authentication support
t-prda Sep 21, 2026
79ef58e
Keep existing API test scenario tags unnumbered
t-prda Sep 21, 2026
0ed0d44
Create posting setup before country-specific unit test initialization
t-prda Sep 21, 2026
bd80ea3
Ensure country VAT fixtures reference existing accounts before unit t…
t-prda Sep 21, 2026
2d45e6f
Make Spend Request unit fixtures independent of demo data
t-prda Sep 22, 2026
67d0e3c
Remove shadowing Human Resource test library declarations
t-prda Sep 22, 2026
87357b7
Reset unique expense payment fixtures between Spend Request tests
t-prda Sep 22, 2026
af10e62
Respect Graph test helper response and error contracts
t-prda Sep 23, 2026
ff267e3
Use supported GUID conversion for API identity diagnostics
t-prda Sep 23, 2026
29d7bb5
Persist owner and date-only Travel Request API posts
t-prda Sep 24, 2026
aaa5a76
Merge current main and retain both Spend Request test imports
t-prda Sep 24, 2026
40a64b5
Correct Dataverse URL and JWT expiry test fixtures
t-prda Sep 25, 2026
c52631a
Use valid Dataverse URLs in assisted setup test fixtures
t-prda Sep 28, 2026
5de4cb7
Keep BCApps repair scope limited to Expense Agent
t-prda Sep 28, 2026
6813951
Merge main and preserve Expense permission test isolation
t-prda Sep 30, 2026
2380c0b
Give activity log E2E approver unlimited approval
t-prda Sep 30, 2026
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
20 changes: 15 additions & 5 deletions src/Apps/W1/ExpenseAgent/app/src/APIs/TravelRequestsAPI.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ page 7134 "Travel Requests API"
{
Caption = 'Requested By';
ToolTip = 'Specifies the employee who created the request. This value can be set only when creating the request.';

trigger OnValidate()
begin
RequestedByProvided := true;
end;
}
field(status; Rec.Status)
{
Expand Down Expand Up @@ -98,6 +103,8 @@ page 7134 "Travel Requests API"

trigger OnValidate()
begin
// Mark the record changed while deferring validation until the complete date pair is available.
Rec."Expected Start Date" := ExpectedStartDate;
ExpectedStartDateProvided := true;
end;
}
Expand All @@ -108,6 +115,7 @@ page 7134 "Travel Requests API"

trigger OnValidate()
begin
Rec."Expected End Date" := ExpectedEndDate;
ExpectedEndDateProvided := true;
end;
}
Expand Down Expand Up @@ -240,12 +248,10 @@ page 7134 "Travel Requests API"
end;

trigger OnNewRecord(BelowxRec: Boolean)
var
OwnerEmployeeNo: Code[20];
begin
OwnerEmployeeNo := ProcessOwnerFilter();
if OwnerEmployeeNo <> '' then
Rec."Requested By" := OwnerEmployeeNo;
ProcessOwnerFilter();
Clear(Rec."Requested By");
RequestedByProvided := false;
Clear(CurrencyCodeDisplay);
Clear(ExpectedStartDate);
Clear(ExpectedEndDate);
Expand Down Expand Up @@ -340,6 +346,9 @@ page 7134 "Travel Requests API"
trigger OnInsertRecord(BelowxRec: Boolean): Boolean
begin
Rec."Document Type" := Rec."Document Type"::"Travel Request";
// Default the owner only at insertion so an owner-only POST remains a record change.
if not RequestedByProvided then
Rec."Requested By" := ProcessOwnerFilter();
Rec.TestField("Requested By");
CheckOwnerScope();
Rec.SetExpectedDatesForAPIInsert(ExpectedStartDate, ExpectedEndDate, ExpectedStartDateProvided, ExpectedEndDateProvided);
Expand Down Expand Up @@ -426,6 +435,7 @@ page 7134 "Travel Requests API"
ExpectedEndDate: Date;
ExpectedStartDateProvided: Boolean;
ExpectedEndDateProvided: Boolean;
RequestedByProvided: Boolean;
StatusCannotBeChangedErr: Label 'can be changed only by submitting, approving, or rejecting the travel request';
RequestedByCannotBeChangedErr: Label 'cannot be changed';
TravelRequestMustBeApprovedErr: Label 'Travel request %1 must be approved before an expense report can be created.', Comment = '%1 = Travel Request No.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ codeunit 148343 "Expense Activity Log API Test"

CreateTestExpenseUser(ApproverExpenseUser);
ApproverExpenseUser."Can Approve" := true;
ApproverExpenseUser.Validate("Unlimited Approval", true);
ApproverExpenseUser."User Id For Approvals" :=
CopyStr('APPROVER-' + RunToken, 1, MaxStrLen(ApproverExpenseUser."User Id For Approvals"));
ApproverExpenseUser.Modify();
Expand Down
Loading
Loading