Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Determines whether to enable or disable the object.
Syntax
public boolean enabled(ConfigurationKeyId configurationKeyId, [boolean enable])
Run On
Called
Parameters
- 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.
Return Value
Type: boolean
true if the object is enabled; otherwise, false.
Remarks
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.
Examples
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;
}