Codeunit 2014 Entity Text AI Install
src/System Application/App/Entity Text/src/EntityTextAIInstall.Codeunit.al37 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.// ------------------------------------------------------------------------------------------------namespace System.Text;using System.AI;using System.Environment;codeunit 2014 "Entity Text AI Install"{ Subtype = Install; InherentEntitlements = X; InherentPermissions = X; trigger OnInstallAppPerDatabase() begin RegisterCapability(); end; local procedure RegisterCapability() var CopilotCapability: Codeunit "Copilot Capability"; EnvironmentInformation: Codeunit "Environment Information"; LearnMoreUrlTxt: Label 'https://go.microsoft.com/fwlink/?linkid=2226375', Locked = true; begin if EnvironmentInformation.IsSaaSInfrastructure() then if not CopilotCapability.IsCapabilityRegistered(Enum::"Copilot Capability"::"Entity Text") then CopilotCapability.RegisterCapability(Enum::"Copilot Capability"::"Entity Text", Enum::"Copilot Availability"::"Generally Available", Enum::"Copilot Billing Type"::"Not Billed", LearnMoreUrlTxt); end; [EventSubscriber(ObjectType::Page, Page::"Copilot AI Capabilities", 'OnRegisterCopilotCapability', '', false, false)] local procedure OnRegisterCopilotCapability() begin RegisterCapability(); end;}