Skip to content
Draft
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 @@ -4,6 +4,7 @@
// ------------------------------------------------------------------------------------------------
namespace System.AI;

using System.Agents;
using System.Environment;
using System.Privacy;

Expand Down Expand Up @@ -310,12 +311,14 @@ page 7775 "Copilot AI Capabilities"

trigger OnOpenPage()
var
AgentUtilities: Codeunit "Agent Utilities";
EnvironmentInformation: Codeunit "Environment Information";
SystemPrivacyNoticeReg: Codeunit "System Privacy Notice Reg.";
WithinGeo: Boolean;
WithinEUDB: Boolean;
TaskId: Integer;
begin
AgentUtilities.BlockPageFromBeingOpenedByAgent();
OnRegisterCopilotCapability();

CopilotCapabilityImpl.CheckGeoAndEUDB(WithinGeo, WithinEUDB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ codeunit 4312 "Agent Session"
[Scope('OnPrem')]
procedure IsAgentSession(var ActiveAgentMetadataProvider: Enum "Agent Metadata Provider"): Boolean
var
AgentSessionImpl: Codeunit "Agent Session Impl.";
AgentUtilities: Codeunit "Agent Utilities";
begin
exit(AgentSessionImpl.IsAgentSession(ActiveAgentMetadataProvider));
exit(AgentUtilities.IsAgentSession(ActiveAgentMetadataProvider));
end;

/// <summary>
Expand All @@ -32,8 +32,8 @@ codeunit 4312 "Agent Session"
[Scope('OnPrem')]
procedure GetCurrentSessionAgentTaskId(): BigInteger
var
AgentSessionImpl: Codeunit "Agent Session Impl.";
AgentUtilities: Codeunit "Agent Utilities";
begin
exit(AgentSessionImpl.GetCurrentSessionAgentTaskId());
exit(AgentUtilities.GetCurrentSessionAgentTaskId());
end;
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,6 @@ codeunit 4300 "Agent Task Impl."
Summary := PageSummaryProvider.GetPageSummary(PageSummaryParameters);
end;

procedure GetSessionAgentTaskId(): BigInteger
var
AgentALFunctions: DotNet AgentALFunctions;
begin
exit(AgentALFunctions.GetSessionAgentTaskId());
end;

var
MessageTextMustBeProvidedErr: Label 'You must provide a message text.';
AreYouSureThatYouWantToRestartTheTaskQst: Label 'Are you sure that you want to restart the task?';
Expand Down
4 changes: 2 additions & 2 deletions src/System Application/App/Agent/Setup/Agent.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ codeunit 4321 Agent
[Scope('OnPrem')]
procedure SetInstructions(AgentUserSecurityID: Guid; Instructions: SecretText)
var
AgentImpl: Codeunit "Agent Impl.";
AgentUtilities: Codeunit "Agent Utilities";
begin
AgentImpl.SetInstructions(AgentUserSecurityID, Instructions);
AgentUtilities.SetInstructions(AgentUserSecurityID, Instructions);
end;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ page 4320 "Agent Access Control"
}
}

trigger OnOpenPage()
var
AgentUtilities: Codeunit "Agent Utilities";
begin
AgentUtilities.BlockPageFromBeingOpenedByAgent();
end;

trigger OnAfterGetRecord()
begin
UpdateGlobalVariables();
Expand Down
5 changes: 2 additions & 3 deletions src/System Application/App/Agent/Setup/AgentCard.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,9 @@ page 4315 "Agent Card"

trigger OnOpenPage()
var
AgentSessionImpl: Codeunit "Agent Session Impl.";
AgentUtilities: Codeunit "Agent Utilities";
begin
AgentSessionImpl.BlockPageFromBeingOpenedByAgent();

AgentUtilities.BlockPageFromBeingOpenedByAgent();
if not Rec.WritePermission() then
Error(YouDoNotHavePermissionToModifyThisAgentErr);
end;
Expand Down
21 changes: 0 additions & 21 deletions src/System Application/App/Agent/Setup/AgentImpl.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,6 @@ codeunit 4301 "Agent Impl."
ChangeAgentState(AgentUserSecurityID, false);
end;

[NonDebuggable]
internal procedure SetInstructions(AgentUserSecurityID: Guid; Instructions: SecretText)
var
AgentALFunctions: DotNet AgentALFunctions;
begin
AgentALFunctions.SetInstructions(AgentUserSecurityID, Instructions.Unwrap());
end;

[NonDebuggable]
internal procedure GetInstructions(AgentUserSecurityID: Guid): SecretText
var
AgentALFunctions: DotNet AgentALFunctions;
InstructionsAsSecretText: SecretText;
begin
if IsNullGuid(AgentUserSecurityID) then
exit;

InstructionsAsSecretText := AgentALFunctions.GetInstructions(AgentUserSecurityID);
exit(InstructionsAsSecretText);
end;

internal procedure InsertCurrentOwnerIfNoOwnersDefined(var Agent: Record Agent; var AgentAccessControl: Record "Agent Access Control")
begin
SetOwnerFilters(AgentAccessControl);
Expand Down
4 changes: 2 additions & 2 deletions src/System Application/App/Agent/Setup/AgentList.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ page 4316 "Agent List"
trigger OnOpenPage()
var
AgentImpl: Codeunit "Agent Impl.";
AgentSessionImpl: Codeunit "Agent Session Impl.";
AgentUtilities: Codeunit "Agent Utilities";
AgentMetadataProvider: Enum "Agent Metadata Provider";
begin
AgentSessionImpl.BlockPageFromBeingOpenedByAgent();
AgentUtilities.BlockPageFromBeingOpenedByAgent();
// Check if there are any agents available
if AgentMetadataProvider.Names().Count() = 0 then
AgentImpl.ShowNoAgentsAvailableNotification();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ page 4317 "Agent User Settings"
}

trigger OnOpenPage()
var
AgentUtilities: Codeunit "Agent Utilities";
begin
AgentUtilities.BlockPageFromBeingOpenedByAgent();

if not Rec.Initialized then
UserSettings.GetUserSettings(Rec."User Security ID", Rec);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ pageextension 4318 "Agent User Subform" extends "User Subform"
}
}

trigger OnOpenPage()
var
AgentUtilities: Codeunit "Agent Utilities";
begin
AgentUtilities.BlockPageFromBeingOpenedByAgent();
end;

trigger OnAfterGetRecord()
begin
UpdateGlobalVariables();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace System.Apps;

using System.Agents;
using System.Environment;
using System.Environment.Configuration;
using System.Integration;
Expand Down Expand Up @@ -395,7 +396,11 @@ page 2500 "Extension Management"
end;

trigger OnOpenPage()
var
AgentUtilities: Codeunit "Agent Utilities";
begin
AgentUtilities.BlockPageFromBeingOpenedByAgent();

DetermineEnvironmentConfigurations();
SetExtensionManagementFilter();
if not IsInstallAllowed then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

namespace System.Environment.Configuration;

using System.Agents;

/// <summary>
/// Page that enables a user to pick which new features to use
/// </summary>
Expand Down Expand Up @@ -231,9 +233,12 @@ page 2610 "Feature Management"

trigger OnOpenPage()
var
AgentUtilities: Codeunit "Agent Utilities";
FeatureIDFilter: Text;
IgnoreFilter: Boolean;
begin
AgentUtilities.BlockPageFromBeingOpenedByAgent();

OnOpenFeatureMgtPage(FeatureIDFilter, IgnoreFilter);
if not IgnoreFilter and (FeatureIDFilter <> '') then begin
Rec.FilterGroup(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace System.Security.AccessControl;

using System.Agents;
using System.Telemetry;
using System.Security.User;

Expand Down Expand Up @@ -168,8 +169,11 @@ page 9855 "Permission Set"

trigger OnOpenPage()
var
AgentUtilities: Codeunit "Agent Utilities";
FeatureTelemetry: Codeunit "Feature Telemetry";
begin
AgentUtilities.BlockPageFromBeingOpenedByAgent();

FeatureTelemetry.LogUptake('0000HZJ', ComposablePermissionSetsTok, Enum::"Feature Uptake Status"::Discovered);
UpdatePageParts();
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace System.Security.AccessControl;

using System.Agents;
using System.Telemetry;
using System.Utilities;
using System.Security.User;
Expand Down Expand Up @@ -272,9 +273,12 @@ page 9871 "Security Groups"

trigger OnOpenPage()
var
AgentUtilities: Codeunit "Agent Utilities";
FeatureTelemetry: Codeunit "Feature Telemetry";
UserPermissions: Codeunit "User Permissions";
begin
AgentUtilities.BlockPageFromBeingOpenedByAgent();

CanManageUsersOnTenant := UserPermissions.CanManageUsersOnTenant(UserSecurityId());
FeatureTelemetry.LogUptake('0000JGR', 'Security Groups', Enum::"Feature Uptake Status"::Discovered);
RefreshData();
Expand Down
Loading