DictTable.fieldName2Id Method

Returns the field ID of a field that is specified by name.

Syntax

public FieldId fieldName2Id(str name)

Run On

Called

Parameters

  • name
    Type: str
    The name of the field for which the field ID is being retrieved.

Return Value

Type: FieldId Extended Data Type
The field ID of the field that is specified by the name parameter; 0 (zero) if name does not represent a valid field name for the table.

Examples

The following example shows the retrieval of a field ID by its field name.

DictTable dt; 
fieldId   fId; 
 
dt = new DictTable(tablenum(CustTable)); 
 
if (dt) 
{ 
    fId = dt.fieldName2Id("Pager"); 
    // Use the field ID as needed. 
    // This example merely prints out the field ID. 
    print (strfmt("fId: %1", fId)); 
}

See Also

DictTable Class

DictField Class