Table 18122329 EOS004 Feature Flag
Table 18122329 EOS004 Feature Flag
Provides access to feature flags that can be used to enable or disable specific features in the application.
Fields
AppId (15)
Guid
The Id of the application that the feature belongs to.
Code (20)
Code[20]
The code of the feature.
Description (50)
Text[100]
A brief description of the feature.
Help URL (60)
Text[250]
The URL to the help page for more information and detailed documentation of the feature.
Mandatory in Version (61)
Integer
Specifies the major version in which the feature will become mandatory.
Per Company (70)
Boolean
Specifies whether the feature can be enabled or disabled per company or for the entire database only.
Reversible (80)
Boolean
Specifies whether the feature can be disabled after it has been enabled.
Methods
IsEnabled
procedure IsEnabled(): Boolean
Gets the current state of the feature flag.
Parameters / Return Value
Returns
Booleantrueif the feature is enabled.
SetEnabledYesNo
procedure SetEnabledYesNo(NewEnabled: Boolean): Boolean
Enables or disables the feature. This method will prompt the user for confirmation.
Parameters / Return Value
NewEnabled
BooleanReturns
Booleantrueif the state changed,falseif the feature already was in the desired state.
SetEnabled
procedure SetEnabled(NewEnabled: Boolean): Boolean
Enables or disables the feature. This method will not prompt the user and ignores any permission restrictions. Use this with caution and only from installer and/or upgeade codeunits.
Parameters / Return Value
NewEnabled
BooleanReturns
Booleantrueif the state changed,falseif the feature already was in the desired state.
GetLastModified
procedure GetLastModified(var LastModifiedBy: Text; var LastModifiedAt: DateTime): Boolean
Retruns the last user who modified the feature flag and the date and time of the last modification.
Parameters / Return Value
LastModifiedBy
Text[]The name of the user who last modified the feature flag.
LastModifiedAt
DateTimeThe date and time of the last modification.
Returns
Booleanfalseif the feature has never been set or modified,trueotherwise.
Collect
procedure Collect(Force: Boolean)
Collects all feature flags currently on the system and writes them to the current record instance.
Parameters / Return Value
Force
BooleanIf
true, the feature flags will always be reloaded from the database. Iffalse, the feature flags will only be reloaded if they have not been loaded yet.
InitNewRecordForCaller
procedure InitNewRecordForCaller(FeatureCode: Code[20]; FeatureDescription: Text[100])
Initialize a new record with the specified feature code and description using the caller as the owning app. Use this when registering new feature flags.
Parameters / Return Value
FeatureCode
Code[20]A app-wide unique code for the feature.
FeatureDescription
Text[100]A brief description of the feature.
InitNewRecord
procedure InitNewRecord(mi: ModuleInfo; FeatureCode: Code[20]; FeatureDescription: Text[100])
Initialize a new record with the specified feature code and description. Use this when registering new feature flags.
Parameters / Return Value
mi
ModuleInfoThe module info of the app that the feature belongs to.
FeatureCode
Code[20]A app-wide unique code for the feature.
FeatureDescription
Text[100]A brief description of the feature.
GetRecord
procedure GetRecord(mi: ModuleInfo; FeatureCode: Code[20])
Get the feature flag record for the specified app module and feature code. This is a TryFunction.
Parameters / Return Value
mi
ModuleInfoThe module info of the app that the feature belongs to.
FeatureCode
Code[20]
GetRecordForCaller
procedure GetRecordForCaller(FeatureCode: Code[20])
Get the feature flag record for the specified feature code using the caller as the owning app. This is a TryFunction.
Parameters / Return Value
- FeatureCode
Code[20]
Events
OnCollectFeatureFlags
local procedure OnCollectFeatureFlags(var TempFeatureFlag: Record "EOS004 Feature Flag")
Raised when feature flags are collected. Use this to register your feature flags to the system.
Parameters / Return Value
TempFeatureFlag
Record "EOS004 Feature Flag"A temporary record instance where you need to write your feature flags to.
OnBeforeEnableDisableFeature
local procedure OnBeforeEnableDisableFeature(AppId: Guid; FeatureCode: Code[20]; NewIsEnabled: Boolean)
Raised before a feature is enabled or disabled. You should use this event to handle custom logic that prevents the feature from being enabled or disabled.
Parameters / Return Value
AppId
GuidFeatureCode
Code[20]NewIsEnabled
BooleanThe new value of the Enabled field.
OnAfterEnableDisableFeature
local procedure OnAfterEnableDisableFeature(AppId: Guid; FeatureCode: Code[20]; NewIsEnabled: Boolean)
Raised after a feature is enabled or disabled. Use this event to handle your custom logic that needs to be executed when the feature is enabled.
Parameters / Return Value
AppId
GuidFeatureCode
Code[20]NewIsEnabled
BooleanThe new value of the Enabled field.
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.