fieldNum Function

Returns the ID number of the specified field.


int fieldNum(str tableName, str fieldName)

Parameter

Description

tableName

The name of the table.

fieldName

The name of the field.

The ID of the specified field.

This function is a compile-time function, which is a metadata assertion function. Compile-time functions take arguments that represent entities in the Application Object Tree (AOT) and validate these arguments at compile time. They have no effect at run time.

The following example prints the number of the CashDisc field in the CustTable table.

static void fieldNumExample(Args _args)
{
    int myInt;
    ;

    myInt = fieldNum(CustTable, CashDisc);
    Global::info(strfmt("CashDisc has a field ID of %1 in the CustTable table.", myInt));
}
/****Infolog Display
Message (10:40:00 am)
CashDisc has a field ID of 10 in the CustTable table.
****/

Community Additions

ADD
Show: