Table of Contents

Codeunit "Extension Management"

ID 2504
Namespace: System.Apps

Provides features for installing and uninstalling, downloading and uploading, configuring and publishing extensions and their dependencies.

Properties

Name Value
Access Public

Methods

InstallExtension

Installs an extension, based on its PackageId and Locale Identifier.

procedure InstallExtension(PackageId: Guid, lcid: Integer, IsUIEnabled: Boolean): Boolean

Parameters

Name Type Description
PackageId Guid

The ID of the extension package.

lcid Integer

The Locale Identifier.

IsUIEnabled Boolean

Indicates whether the install operation is invoked through the UI.

Returns

Type Description
Boolean

True if the extention is installed successfully; false otherwise.

UninstallExtension

Uninstalls an extension, based on its PackageId.

procedure UninstallExtension(PackageId: Guid, IsUIEnabled: Boolean): Boolean

Parameters

Name Type Description
PackageId Guid

The ID of the extension package.

IsUIEnabled Boolean

Indicates if the uninstall operation is invoked through the UI.

Returns

Type Description
Boolean

True if the extention is uninstalled successfully; false otherwise.

UninstallExtensionAndDeleteExtensionData

Uninstalls an extension, based on its PackageId and permanently deletes the tables that contain data for the extension.

procedure UninstallExtensionAndDeleteExtensionData(PackageId: Guid, IsUIEnabled: Boolean): Boolean

Parameters

Name Type Description
PackageId Guid

The ID of the extension package.

IsUIEnabled Boolean

Indicates if the uninstall operation is invoked through the UI.

Returns

Type Description
Boolean

True if the extention is uninstalled successfully; false otherwise.

UploadExtension

Uploads an extension, using a File Stream and based on the Locale Identifier. This method is only applicable in SaaS environment.

procedure UploadExtension(FileStream: InStream, lcid: Integer)

Parameters

Name Type Description
FileStream InStream

The File Stream containing the extension to be uploaded.

lcid Integer

The Locale Identifier.

DeployExtension

Deploys an extension, based on its ID and Locale Identifier. This method is only applicable in SaaS environment.

procedure DeployExtension(AppId: Guid, lcid: Integer, IsUIEnabled: Boolean)

Parameters

Name Type Description
AppId Guid

The AppId of the extension.

lcid Integer

The Locale Identifier.

IsUIEnabled Boolean

Indicates whether the install operation is invoked through the UI.

UnpublishExtension

Unpublishes an extension, based on its PackageId. An extension can only be unpublished, if it is a per-tenant one and it has been uninstalled first.

procedure UnpublishExtension(PackageId: Guid): Boolean

Parameters

Name Type Description
PackageId Guid

The PackageId of the extension.

Returns

Type Description
Boolean

True if the extention is unpublished successfully; false otherwise.

DownloadExtensionSource

Downloads the source of an extension, based on its PackageId.

procedure DownloadExtensionSource(PackageId: Guid): Boolean

Parameters

Name Type Description
PackageId Guid

The PackageId of the extension.

Returns

Type Description
Boolean

True if the operation was successful; false otherwise.

GetExtensionSource

Retrives the source of an extension, based on its PackageId.

procedure GetExtensionSource(PackageId: Guid, var ExtensionSourceTempBlob: Codeunit "Temp Blob"): Boolean

Parameters

Name Type Description
PackageId Guid

The PackageId of the extension.

ExtensionSourceTempBlob Codeunit System.Utilities."Temp Blob"

TempBlob where the zip is stored.

Returns

Type Description
Boolean

True if the operation was successful; false otherwise.

IsInstalledByPackageId

Checks whether an extension is installed, based on its PackageId.

procedure IsInstalledByPackageId(PackageId: Guid): Boolean

Parameters

Name Type Description
PackageId Guid

The ID of the extension package.

Returns

Type Description
Boolean

The result of checking whether an extension is installed.

IsInstalledByAppId

Checks whether an extension is installed, based on its AppId.

procedure IsInstalledByAppId(AppId: Guid): Boolean

Parameters

Name Type Description
AppId Guid

The AppId of the extension.

Returns

Type Description
Boolean

The result of checking whether an extension is installed.

GetAllExtensionDeploymentStatusEntries

Retrieves a list of all the Deployment Status Entries

procedure GetAllExtensionDeploymentStatusEntries(var TempExtensionDeploymentStatus: Record "Extension Deployment Status" temporary)

Parameters

Name Type Description
TempExtensionDeploymentStatus Table System.Apps."Extension Deployment Status"

Gets the list of all the Deployment Status Entries in a temporary record.

GetDeployOperationInfo

Retrieves the AppName,Version,Schedule,Publisher by the NAVApp Tenant OperationId.

procedure GetDeployOperationInfo(OperationId: Guid, var Version: Text, var Schedule: Text, var Publisher: Text, var AppName: Text, Description: Text)

Parameters

Name Type Description
OperationId Guid

The OperationId of the NAVApp Tenant.

Version Text

Gets the Version of the NavApp.

Schedule Text

Gets the Schedule of the NavApp.

Publisher Text

Gets the Publisher of the NavApp.

AppName Text

Gets the AppName of the NavApp.

Description Text

The Description of the NavApp; in case no name is provided, the description will replace the AppName.

RefreshStatus

Refreshes the status of the Operation.

procedure RefreshStatus(OperationId: Guid)

Parameters

Name Type Description
OperationId Guid

The Id of the operation to be refreshed.

ConfigureExtensionHttpClientRequestsAllowance

Allows or disallows Http Client requests against the specified extension.

procedure ConfigureExtensionHttpClientRequestsAllowance(PackageId: Text, AreHttpClientRqstsAllowed: Boolean): Boolean

Parameters

Name Type Description
PackageId Text

The Id of the extension to configure.

AreHttpClientRqstsAllowed Boolean

The value to set for "Allow HttpClient Requests".

Returns

Type Description
Boolean

True configuration was successful; false otherwise.

GetLatestVersionPackageIdByAppId

Gets the PackageId of the latest Extension Version by the Extension AppId.

procedure GetLatestVersionPackageIdByAppId(AppId: Guid): Guid

Parameters

Name Type Description
AppId Guid

The AppId of the extension.

Returns

Type Description
Guid

The package ID by app ID. Empty GUID, if package with the provided app ID does not exist.

GetCurrentlyInstalledVersionPackageIdByAppId

Gets the PackageId of the latest version of the extension by the extension's AppId.

procedure GetCurrentlyInstalledVersionPackageIdByAppId(AppId: Guid): Guid

Parameters

Name Type Description
AppId Guid

The AppId of the installed extension.

Returns

Type Description
Guid

The package ID of the installed version of an extenstion. Empty GUID, if package with the provided app ID does not exist.

GetSpecificVersionPackageIdByAppId

Gets the package ID of the version of the extension by the extension's AppId, Name, Version Major, Version Minor, Version Build, Version Revision.

procedure GetSpecificVersionPackageIdByAppId(AppId: Guid, Name: Text, VersionMajor: Integer, VersionMinor: Integer, VersionBuild: Integer, VersionRevision: Integer): Guid

Parameters

Name Type Description
AppId Guid

The AppId of the extension.

Name Text

The input/output Name parameter of the extension. If there is no need to filter by this parameter, the default value is ''.

VersionMajor Integer

The input/output Version Major parameter of the extension. If there is no need to filter by this parameter, the default value is "0".

VersionMinor Integer

The input/output Version Minor parameter of the extension. If there is no need to filter by this parameter, the default value is "0"..

VersionBuild Integer

The input/output Version Build parameter of the extension. If there is no need to filter by this parameter, the default value is "0".

VersionRevision Integer

The input/output Version Revision parameter of the extension. If there is no need to filter by this parameter, the default value is "0".

Returns

Type Description
Guid

The package ID of the extension with the specified paramters.

GetExtensionLogo

Gets the logo of an extension.

procedure GetExtensionLogo(AppId: Guid, var LogoTempBlob: Codeunit "Temp Blob")

Parameters

Name Type Description
AppId Guid

The App ID of the extension.

LogoTempBlob Codeunit System.Utilities."Temp Blob"

Out parameter holding the logo of the extension.

UploadExtensionToVersion

Uploads an extension to current version, next minor or next major, using a File Stream and based on the Locale Identifier. This method is only applicable in SaaS environment.

procedure UploadExtensionToVersion(FileInStream: InStream, lcid: Integer, DeployTo: Enum "Extension Deploy To")

Parameters

Name Type Description
FileInStream InStream

The File Stream containing the extension to be uploaded.

lcid Integer

The Locale Identifier.

DeployTo Enum System.Apps."Extension Deploy To"

The version that the extension will be deployed to.

UploadExtensionToVersion

Uploads an extension to current version, next minor or next major, using a File Stream and based on the Locale Identifier. This method is only applicable in SaaS environment.

procedure UploadExtensionToVersion(FileInStream: InStream, lcid: Integer, DeployTo: Enum "Extension Deploy To", SyncMode: Enum "Extension Sync Mode")

Parameters

Name Type Description
FileInStream InStream

The File Stream containing the extension to be uploaded.

lcid Integer

The Locale Identifier.

DeployTo Enum System.Apps."Extension Deploy To"

The version that the extension will be deployed to.

SyncMode Enum System.Apps."Extension Sync Mode"

The desired sync mode.

InstallMarketplaceExtension

Installs an extension, based on its extension id.

procedure InstallMarketplaceExtension(AppId: Guid)

Parameters

Name Type Description
AppId Guid

The ID of the extension package.

GetAppName

Returns the Name of the app given the App Id.

procedure GetAppName(AppId: Guid): Text

Parameters

Name Type Description
AppId Guid

The unique identifier of the app.

Returns

Type Description
Text

The name of the app.

GetDeploymentDetailedStatusMessage

Returns the detailed message from a deployment operation.

procedure GetDeploymentDetailedStatusMessage(OperationId: Guid): Text

Parameters

Name Type Description
OperationId Guid

The Id of the operation to get the detailed message from.

Returns

Type Description
Text

The detailed message as text.

GetDeploymentDetailedStatusMessageAsStream

Writes the detailed message from a deployment operation to a stream.

procedure GetDeploymentDetailedStatusMessageAsStream(OperationId: Guid, OutStream: OutStream)

Parameters

Name Type Description
OperationId Guid

The Id of the operation to get the detailed message from.

OutStream OutStream

An OutStream to write the message to.

See also