FormControl.configurationKey Method [AX 2012]

Gets or sets the configuration key that is assigned to the control.

public ConfigurationKeyId configurationKey([ConfigurationKeyId value])

Run On

Client

Parameters

value
Type: ConfigurationKeyId Extended Data Type
The ID of the configuration key to assign to the control; optional.

Return Value

Type: ConfigurationKeyId Extended Data Type
The ID of the configuration key that is assigned to the control.

The configuration key is used to determine whether this control can be displayed. If the configuration key is disabled in the system, the control is not displayed in the form.

The following example shows how to set and retrieve the configuration key for a control.

DictConfigurationKey dck; 
configurationKeyId cki; 
 
// objCtrl previously assigned. 
// Assign a configuration key to the control. 
objCtrl.configurationKey(configurationkeynum(BankDeposit)); 
 
// Retrieve the configuration key ID from the control. 
cki = objCtrl.configurationKey(); 
if (cki != 0) 
{ 
    dck = new DictConfigurationKey(cki); 
    if (dck) 
    { 
    print strfmt("Configuration Key ID: %1 Configuration Key Name: %2", 
                  cki, 
                  dck.name()); 
    } 
}

Community Additions

ADD
Show: