Codeunit 18122325 EOS004 Upgrade Tags
Codeunit 18122325 EOS004 Upgrade Tags
Wrapper for upgrade tag management using the predefined EOS format.
Methods
SetApp
procedure SetApp(app: ModuleInfo)
Sets the app for which upgrade tags should be handled. This method must be called before any other method can be executed.
Parameters / Return Value
app
ModuleInfoThe app for which upgrade tags should be handled.
CreateTags
procedure CreateTags(Tags: List of [Code[250]]; isDatabaseUpgrade: Boolean)
This is a utility function to facilitate writing upgrade code. Use this to create tags massively, usually called in install codeunits to create tags during first installation. See the example on https://github.com/EOS-Solutions/Sample/tree/master/Upgrade%20Boilerplate. This method does NOT require the codeunit to be initialized via SetApp (and friends) because it writes all tags as-is.
Parameters / Return Value
Tags
List[Code]The tags to be created.
isDatabaseUpgrade
BooleanCreate the tags as per-company upgrade or per-database upgrade?
SetApp
procedure SetApp(app: ModuleInfo; isDatabaseUpgrade: Boolean)
Sets the app for which upgrade tags should be handled if the upgrade is for database. This method must be called before any other method can be executed.
Parameters / Return Value
app
ModuleInfoThe app for which upgrade tags should be handled.
isDatabaseUpgrade
Boolean
SetAppFromCaller
procedure SetAppFromCaller()
Sets the app for which upgrade tags should be handled by using the caller’s app. This method must be called before any other method can be executed.
HasUpgradeTag
procedure HasUpgradeTag(WorkItemId: Integer): Boolean
Check if an upgrade tag for the specified work item exists.
Parameters / Return Value
WorkItemId
IntegerThe ID of the work item.
Returns
Booleantrueif it exists,falseotherwise.
HasUpgradeTag
procedure HasUpgradeTag(WorkItemId: Integer; Iteration: Integer): Boolean
Check if an upgrade tag for the specified work item and iteration exists.
Parameters / Return Value
WorkItemId
IntegerThe ID of the work item.
Iteration
IntegerThe number of the iteration. Defaults to 1.
Returns
Booleantrueif it exists,falseotherwise.
SetUpgradeTag
procedure SetUpgradeTag(WorkItemId: Integer)
Creates an upgrade tag for the specified work item.
Parameters / Return Value
WorkItemId
IntegerThe ID of the work item.
SetUpgradeTag
procedure SetUpgradeTag(WorkItemId: Integer; Iteration: Integer)
Creates an upgrade tag for the specified work item and iteration.
Parameters / Return Value
WorkItemId
IntegerThe ID of the work item.
Iteration
IntegerThe number of the iteration. Defaults to 1.
SetUpgradeTagIfNotExists
procedure SetUpgradeTagIfNotExists(WorkItemId: Integer; Iteration: Integer): Boolean
Creates an upgrade tag for the specified work item and iteration, if it not already exists.
Parameters / Return Value
WorkItemId
IntegerThe ID of the work item.
Iteration
IntegerThe number of the iteration. Defaults to 1.
Returns
Booleantrueif the upgrade tag did not exist and was created.falseif the tag already existed.
SetUpgradeTagIfNotExists
procedure SetUpgradeTagIfNotExists(WorkItemId: Integer): Boolean
Creates an upgrade tag for the specified work item and iteration, if it not already exists.
Parameters / Return Value
WorkItemId
IntegerThe ID of the work item.
Returns
Booleantrueif the upgrade tag did not exist and was created.falseif the tag already existed.
BeginUpgrade
procedure BeginUpgrade(WorkItemId: Integer): Boolean
Starts an upgrade for the specified work item and returns true if the upgrade should proceed.
If the upgrade tag already exists, false is returned and you should abort the upgrade.
If an upgrade is already in progress, an error is thrown, upgrades must first be ended via EndUpgrade.
Parameters / Return Value
WorkItemId
IntegerThe work item ID
Returns
Booleantrueif the tag did not yet exist and upgrade should proceed.Falseotherwise.
BeginUpgrade
procedure BeginUpgrade(WorkItemId: Integer; Iteration: Integer): Boolean
Starts an upgrade for the specified work item and iteration and returns true if the upgrade should proceed.
If the upgrade tag already exists, false is returned and you should abort the upgrade.
If an upgrade is already in progress, an error is thrown, upgrades must first be ended via EndUpgrade.
Parameters / Return Value
WorkItemId
IntegerThe work item ID
Iteration
IntegerThe iteration
Returns
Booleantrueif the tag did not yet exist and upgrade should proceed.Falseotherwise.
EndUpgrade
procedure EndUpgrade()
Stops the upgrade that was started via BeginUpgrade.
This will log a message to telemetry and set the upgrade tag.
If no upgrade is in progress, an error is thrown.
FormatTag
procedure FormatTag(WorkItemId: Integer): Code[250]
Returns an upgrade tag formatted according to EOS defined rules and specifications.
Parameters / Return Value
WorkItemId
IntegerThe work item ID
Returns
Code[250]The upgrade tag
FormatTag
procedure FormatTag(WorkItemId: Integer; Iteration: Integer): Code[250]
Returns an upgrade tag formatted according to EOS defined rules and specifications.
Parameters / Return Value
WorkItemId
IntegerThe work item ID
Iteration
IntegerThe iteration
Returns
Code[250]The upgrade tag
MigratePermissionSet
procedure MigratePermissionSet(OldName: Code[20]; NewName: Code[20])
Migrates a users permission set from the old tenant scope to the new AL system scope.
Parameters / Return Value
OldName
Code[20]The old name the permission set had in the XML file.
NewName
Code[20]The name of the permission set in AL.
MigratePermissionSet
procedure MigratePermissionSet(OldName: Code[20]; NewName: Code[20]; Module: ModuleInfo)
Migrates a users permission set from the old tenant scope to the new AL system scope.
Parameters / Return Value
OldName
Code[20]The old name the permission set had in the XML file.
NewName
Code[20]The name of the permission set in AL.
Module
ModuleInfoThe app for which to migrate.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.