Share via


DictField.aliasFor Method

Definition

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

public:
 virtual int aliasFor();
public virtual int aliasFor ();
abstract member aliasFor : unit -> int
override this.aliasFor : unit -> int
Public Overridable Function aliasFor () As Integer

Returns

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.

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))); 
    } 
}

Applies to