fieldNum Function [AX 2012]

Updated: August 25, 2010

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

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.
****/

Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).

Community Additions

ADD
Show: