Share via


DictField.aliasFor Method

Returns the ID of the alias field, if the field is an alias for another field.

Syntax

public FieldId aliasFor()

Run On

Called

Return Value

Type: FieldId Extended Data Type
The ID of the alias field for the field; 0 (zero) if the field is not an alias for another field.

Remarks

When the user enters data in a field, the validateField method of the table is called. If the validateField method cannot perform a lookup on the value, it checks whether an alias exists. If an alias field exists, the validateField method performs a lookup on the alias field.

Examples

The following example shows the retrieval of the alias field for a field.

DictField df; 
fieldId   fId; 
 
df = new DictField(tablenum(CustTable), fieldnum(CustTable, AccountNum));
 
if (df) 
{ 
    fId = df.aliasFor(); 
    if (0 != fId) 
    { 
        print (strfmt("Field alias: %1", fieldid2name(tablenum(CustTable), fId))); 
    } 
}

See Also

Reference

DictField Class