Codeunit 4401 SOA Metadata Provider

Sales Order Agent, Microsoft.Agent.SalesOrderAgent

src/Apps/W1/SalesOrderAgent/app/src/Setup/SOAMetadataProvider.Codeunit.al102 lines, Copyright (c) Microsoft Corporation. MIT

// ------------------------------------------------------------------------------------------------// Copyright (c) Microsoft Corporation. All rights reserved.// Licensed under the MIT License. See License.txt in the project root for license information.// ------------------------------------------------------------------------------------------------#pragma warning disable AS0007namespace Microsoft.Agent.SalesOrderAgent;using System.Agents;using System.AI;using System.Reflection;using System.Security.AccessControl;codeunit 4401 "SOA Metadata Provider" implements IAgentMetadata, IAgentFactory, IAgentManualTaskCreation{    Access = Internal;    InherentEntitlements = X;    InherentPermissions = X;    procedure GetDefaultInitials(): Text[4]    begin        exit(SOASetupCU.GetInitials());    end;    procedure GetInitials(AgentUserId: Guid): Text[4]    begin        exit(SOASetupCU.GetInitials(AgentUserId));    end;    procedure GetFirstTimeSetupPageId(): Integer    begin        // The first time setup page ID is the same as the setup page ID.        exit(Page::"SOA Setup");    end;    procedure GetSetupPageId(AgentUserId: Guid): Integer    begin        // The first time setup page ID is the same as the setup page ID.        exit(Page::"SOA Setup");    end;    procedure GetSummaryPageId(AgentUserId: Guid): Integer    begin        exit(Page::"SOA KPI");    end;    procedure ShowCanCreateAgent(): Boolean    begin        exit(SOASetupCU.AllowCreateNewSOAgent());    end;    procedure GetCopilotCapability(): Enum "Copilot Capability"    begin        exit("Copilot Capability"::"Sales Order Agent");    end;    procedure GetAgentAnnotations(AgentUserId: Guid; var Annotations: Record "Agent Annotation")    begin        SOAAnnotation.GetAgentAnnotations(AgentUserId, Annotations);    end;    procedure GetAgentTaskMessagePageId(AgentUserId: Guid; MessageId: Guid): Integer    begin        exit(Page::"SOA Email Message");    end;    procedure GetDefaultProfile(var TempAllProfile: Record "All Profile" temporary)    begin        SOASetupCU.GetDefaultProfile(TempAllProfile);    end;    procedure GetDefaultAccessControls(var TempAccessControlBuffer: Record "Access Control Buffer" temporary)    begin        SOASetupCU.GetDefaultAccessControls(TempAccessControlBuffer);    end;    procedure IsManualAgentTaskCreationEnabled(AgentUserId: Guid; ManualTaskType: Enum "Manual Agent Task Creation Type"): Boolean    begin        // Do not read the Agent table here, in any form. The platform calls this method while it builds an        // agent record, and every read of that virtual table, including a filtered IsEmpty, is served by        // building records, which calls this method again until the stack overflows. Filtering does not        // avoid it. The platform already hides task creation for an archived agent, and        // CreateManualAgentTask guards the operation itself.        exit(ManualTaskType = ManualTaskType::Default);    end;    procedure IsMultipleFileUploadAllowed(AgentUserId: Guid): Boolean    begin        exit(false);    end;    procedure CreateManualAgentTask(AgentUserId: Guid; Files: List of [FileUpload])    begin        SOASetupCU.CheckAgentNotArchived(AgentUserId);        SOACreateTaskImpl.OpenCreateTaskPage(AgentUserId);    end;    var        SOAAnnotation: Codeunit "SOA Annotation";        SOACreateTaskImpl: Codeunit "SOA Create Task Impl";        SOASetupCU: Codeunit "SOA Setup";}