Skip to content
Merged
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
23 changes: 17 additions & 6 deletions src/Layers/W1/Tests/Report/ReportInboxAPIE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -573,13 +573,24 @@ codeunit 135549 "Report Inbox API E2E"

local procedure OtherCompanyName(): Text
var
Company: Record Company;
ExistingCompany: Record Company;
begin
Company.SetFilter(Name, '<>%1', CompanyName());
Assert.IsTrue(
Company.FindFirst(),
'This scenario needs a second company; the database has only ' + CompanyName() + '.');
exit(Company.Name);
ExistingCompany.SetFilter(Name, '<>%1', CompanyName());
if ExistingCompany.FindFirst() then
exit(ExistingCompany.Name);

exit(CreateSecondaryCompany());
end;

local procedure CreateSecondaryCompany(): Text
Comment thread
onbuyuka marked this conversation as resolved.
var
NewCompany: Record Company;
begin
NewCompany.LockTable(true);
NewCompany.Name := CopyStr(LibraryUtility.GenerateGUID(), 1, MaxStrLen(NewCompany.Name));
NewCompany.Insert(true);
Commit();
exit(NewCompany.Name);
end;

local procedure SeedEntryForApiCallerIn(CompanyToSeed: Text; NewDescription: Text)
Expand Down
Loading