Share via


FormControl.securityKey Method

Sets or returns the ID of the security key for the control.

Syntax

public SecurityKeyId securityKey([SecurityKeyId value])

Run On

Client

Parameters

Return Value

Type: SecurityKeyId Extended Data Type
The ID of the security key for the control; 0 (zero) if no security key is assigned to the control.

Examples

The following example shows how to retrieve and assign a security key ID for a control.

DictSecurityKey dsk; 
securityKeyId ski; 
 
// objCtrl previously assigned. 
 
// Assign a security key ID to the control. 
objCtrl.securityKey(securitykeynum(AdminDaily)); 
 
// Retrieve the security key ID from the control. 
ski = objCtrl.securityKey(); 
if (ski != 0) 
{ 
    dsk = new DictSecurityKey(ski); 
    if (dsk) 
    { 
        print strfmt("Security Key ID: %1 Security Key Name: %2", 
                     ski, 
                     dsk.name()); 
    } 
}

See Also

FormControl Class

Best Practices for Configuration and Security Keys

DictSecurityKey Class