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 @@ -17,7 +17,6 @@ page 4326 "Agent Creation Control"
PageType = ListPlus;
InsertAllowed = false;
DeleteAllowed = false;
SourceTable = "Agent Creation Control";
UsageCategory = Administration;
DelayedInsert = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ page 4332 "Agent Creation Control Part"
}
field(Description; Rec.Description)
{
ShowMandatory = true;
}
}
}
Expand Down Expand Up @@ -100,7 +101,7 @@ page 4332 "Agent Creation Control Part"
CreationControlLookup.LookupMode := true;
if CreationControlLookup.RunModal() = Action::LookupOK then begin
CreationControlLookup.GetRecord(TempAgentCreationControlLookup);
Rec."Company Name" := CopyStr(TempAgentCreationControlLookup."Key", 1, MaxStrLen(Rec."Company Name"));
Rec.Validate(Rec."Company Name", CopyStr(TempAgentCreationControlLookup."Key", 1, MaxStrLen(Rec."Company Name")));
UpdateDisplayTexts();
end;
end;
Expand Down
48 changes: 47 additions & 1 deletion src/System Application/App/Agent/Setup/AgentList.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ page 4316 "Agent List"
PageType = List;
ApplicationArea = All;
UsageCategory = Administration;
SourceTable = "Agent";
SourceTable = Agent;
Caption = 'Agents', Comment = 'Agents in this page should be translated as AI agents. It is listing the AI agents that users have setup to help with automating tasks.';
CardPageId = "Agent Card";
AdditionalSearchTerms = 'Agent, Agents, Copilot, Automation, AI';
Expand Down Expand Up @@ -47,6 +47,11 @@ page 4316 "Agent List"
{
Caption = 'State';
}
field("Can Access Current Company"; Rec."Can Access Current Company")
{
Caption = 'Can Access Current Company';
Visible = ShouldShowAllCompanies;
}
}
}
}
Expand Down Expand Up @@ -107,6 +112,34 @@ page 4316 "Agent List"
AgentConsumptionOverview.OpenAgentConsumptionOverview(Rec."User Security ID");
end;
}
action(ShowCurrentCompany)
{
ApplicationArea = All;
Caption = 'Show agents for current company';
ToolTip = 'Show only agents that can access the current company.';
Image = FilterLines;
Visible = ShouldShowAllCompanies;

trigger OnAction()
begin
ShouldShowAllCompanies := false;
SetCompanyFilter();
end;
}
action(ShowAllCompanies)
{
ApplicationArea = All;
Caption = 'Show agents for all companies';
ToolTip = 'Show agents from all companies.';
Image = RemoveFilterLines;
Visible = not ShouldShowAllCompanies;

trigger OnAction()
begin
ShouldShowAllCompanies := true;
SetCompanyFilter();
end;
}
}
area(Navigation)
{
Expand Down Expand Up @@ -143,6 +176,9 @@ page 4316 "Agent List"
// Check if there are any agents available
if AgentMetadataProvider.Names().Count() = 0 then
AgentImpl.ShowNoAgentsAvailableNotification();

ShouldShowAllCompanies := false;
SetCompanyFilter();
end;

trigger OnAfterGetCurrRecord()
Expand All @@ -162,7 +198,17 @@ page 4316 "Agent List"
CopilotAvailabilityTxt := AgentImpl.GetCopilotAvailabilityDisplayText(Rec);
end;

local procedure SetCompanyFilter()
begin
if ShouldShowAllCompanies then
Rec.SetRange("Can Access Current Company")
else
Rec.SetRange("Can Access Current Company", true);
CurrPage.Update(false);
end;

var
CopilotAvailabilityTxt: Text;
ShouldShowAllCompanies: Boolean;
NoAgentSetupErr: Label 'No agents have been setup. You must set up an agent first.';
}
Loading