Table 18122329 EOS004 Feature Flag
Provides access to feature flags that can be used to enable or disable specific features in the application.
15
)Guid
The Id of the application that the feature belongs to.
20
)Code[20]
The code of the feature.
50
)Text[100]
A brief description of the feature.
60
)Text[250]
The URL to the help page for more information and detailed documentation of the feature.
61
)Integer
Specifies the major version in which the feature will become mandatory.
70
)Boolean
Specifies whether the feature can be enabled or disabled per company or for the entire database only.
80
)Boolean
Specifies whether the feature can be disabled after it has been enabled.
procedure IsEnabled(): Boolean
Gets the current state of the feature flag.
Returns Boolean
true
if the feature is enabled.
procedure SetEnabledYesNo(NewEnabled: Boolean): Boolean
Enables or disables the feature. This method will prompt the user for confirmation.
NewEnabled Boolean
Returns Boolean
true
if the state changed, false
if the feature already was in the desired state.
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.
NewEnabled Boolean
Returns Boolean
true
if the state changed, false
if the feature already was in the desired state.
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.
LastModifiedBy Text[]
The name of the user who last modified the feature flag.
LastModifiedAt DateTime
The date and time of the last modification.
Returns Boolean
false
if the feature has never been set or modified, true
otherwise.
procedure Collect(Force: Boolean)
Collects all feature flags currently on the system and writes them to the current record instance.
Force Boolean
If true
, the feature flags will always be reloaded from the database. If false
, the feature flags will only be reloaded if they have not been loaded yet.
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.
FeatureCode Code[20]
A app-wide unique code for the feature.
FeatureDescription Text[100]
A brief description of the feature.
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.
mi ModuleInfo
The 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.
procedure GetRecord(mi: ModuleInfo; FeatureCode: Code[20])
Get the feature flag record for the specified app module and feature code. This is a TryFunction.
mi ModuleInfo
The module info of the app that the feature belongs to.
FeatureCode Code[20]
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.
Code[20]
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.
TempFeatureFlag Record "EOS004 Feature Flag"
A temporary record instance where you need to write your feature flags to.
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.
AppId Guid
FeatureCode Code[20]
NewIsEnabled Boolean
The new value of the Enabled field.
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.
AppId Guid
FeatureCode Code[20]
NewIsEnabled Boolean
The new value of the Enabled field.
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.