Page 2511 Extension Settings, source in 24
Source242526272829metadata in 24
src/System Application/App/Extension Management/src/ExtensionSettings.Page.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.
// ------------------------------------------------------------------------------------------------
namespace System.Apps;
using System.Environment.Configuration;
/// <summary>
/// Displays settings for the selected extension, and allows users to edit them.
/// </summary>
page 2511 "Extension Settings"
{
Extensible = false;
DataCaptionExpression = AppNameValue;
PageType = Card;
SourceTable = "NAV App Setting";
ContextSensitiveHelpPage = 'ui-extensions';
Permissions = tabledata "Nav App Setting" = rm,
tabledata "Published Application" = r;
layout
{
area(Content)
{
group(Group)
{
Caption = 'General';
field(AppId; AppIdValue)
{
ApplicationArea = All;
Caption = 'App ID';
Editable = false;
ToolTip = 'Specifies the App ID of the extension.';
}
field(AppName; AppNameValue)
{
ApplicationArea = All;
Caption = 'Name';
Editable = false;
ToolTip = 'Specifies the name of the extension.';
}
field(AppPublisher; AppPublisherValue)
{
ApplicationArea = All;
Caption = 'Publisher';
Editable = false;
ToolTip = 'Specifies the publisher of the extension.';
}
field(AllowHttpClientRequests; Rec."Allow HttpClient Requests")
{
ApplicationArea = All;
Caption = 'Allow HttpClient Requests';
Editable = CanManageExtensions;
ToolTip = 'Specifies whether the runtime should allow this extension to make HTTP requests through the HttpClient data type when running in a non-production environment.';
}
}
}
}
trigger OnAfterGetCurrRecord()
var
PublishedApplication: Record "Published Application";
begin
PublishedApplication.SetRange(ID, Rec."App ID");
PublishedApplication.SetRange("Tenant Visible", true);
if PublishedApplication.FindFirst() then begin
AppNameValue := PublishedApplication.Name;
AppPublisherValue := PublishedApplication.Publisher;
AppIdValue := LowerCase(DelChr(Format(PublishedApplication.ID), '=', '{}'));
end
end;
trigger OnOpenPage()
var
ExtensionInstallationImpl: Codeunit "Extension Installation Impl";
begin
if Rec.GetFilter("App ID") = '' then
exit;
Rec."App ID" := Rec.GetRangeMin("App ID");
if not Rec.FindFirst() then begin
Rec.Init();
Rec.Insert();
end;
CanManageExtensions := ExtensionInstallationImpl.CanManageExtensions();
end;
var
AppNameValue: Text;
AppPublisherValue: Text;
AppIdValue: Text;
CanManageExtensions: Boolean;
}