ConfigurationKeySet.enabled Method [AX 2012]
Determines whether to enable or disable the object.
public boolean enabled(ConfigurationKeyId configurationKeyId, [boolean enable])
Run On
CalledParameters
- configurationKeyId
- Type: ConfigurationKeyId Extended Data Type
The ID of the configuration key to examine or set.
- enable
- Type: boolean
The value to which to set the state of the configuration key; optional.
The enabled property allows controls to be enabled or disabled at run time. For example, you can disable objects that do not apply to the current state of the application. You can also disable a control that is used only for display purposes, such as an error message, which provides read-only information.
This example demonstrates the use of the ConfigurationKeySet.enabled method.
static void testConfigKey(Args _args)
{
ConfigurationKeySet configKey = new ConfigurationKeySet();
configKey.loadSystemSetup();
// Set the enable value to false.
configKey.enabled(configurationkeynum(RouteApprove), false);
SysDictConfigurationKey::save(configKey.pack());
SysSecurity::reload(true);
print isConfigurationkeyEnabled(configurationkeynum(RouteApprove));
// Set the enable value to true.
configKey.enabled(configurationkeynum(RouteApprove), true);
//Save the configuration key setup.
SysDictConfigurationKey::save(configKey.pack());
SysSecurity::reload(true);
print isConfigurationkeyEnabled(configurationkeynum(RouteApprove));
pause;
}
Community Additions
ADD
Show: