SysDictEnum sysDictEnum= new SysDictEnum(enumNum(SysModule));
int sysModuleIndex;
ConfigurationKeySet configurationKeySet = new ConfigurationKeySet();configurationKeySet.loadSystemSetup();// Look at all of the Module enumerations
for (sysModuleIndex = 0; sysModuleIndex < sysDictEnum.values(); sysModuleIndex++)
{
// We don't want the Ledger Module in the mix
if (sysDictEnum.index2Value(sysModuleIndex) != SysModule::Ledger)
{
// if the module exists in the table as a column
if (LedgerPeriodModuleAccessControl::accessLevelFieldName(sysDictEnum.index2Value(sysModuleIndex)) != '')
{
// If configuration key is enabled, then check the access level for the module
if (isConfigurationkeyEnabled(sysDictEnum.index2ConfigurationKey(sysModuleIndex)))
{
str enumFeatureClassName = sysDictEnum.index2FeatureClassName(sysModuleIndex);
// todo: check if the feature is enabled
// then do the thing
}
}
}
}
https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/get-started/feature-management/feature-management-overview
if (FeatureStateProvider::isFeatureEnabled(BatchContentionPreventionFeature::instance()))
str enumFeatureClassName = sysDictEnum.index2FeatureClassName(sysModuleIndex);
if (enumFeatureClassName)
{
info(strFmt('Feature class name: %1', enumFeatureClassName));
DictClass featureClass = new DictClass(className2Id(enumFeatureClassName));
if (featureClass)
{
boolean isFeatureEnabled = FeatureStateProvider::isFeatureEnabled(featureClass.callStatic('instance'));
info(strFmt('%1 isEnabled: %2', enumFeatureClassName, isFeatureEnabled));
}
}