fieldName2Id Function

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

Retrieves the field ID of the table field that is specified by a table ID number and a field ID number.

int fieldName2Id(int tableid, str fieldname)

Parameters

Parameter

Description

tableid

The ID number of the table.

Note

Use the tableName2Id function to specify the ID of a table.

fieldname

The name of the field.

Return Value

The ID of the field that is specified by the tableid and fieldname parameters.

Example

    static void fieldName2IdExample(Args _arg)
    {
        int id;
        ;
        id = fieldName2Id(tableName2Id("Address"), "Name");
        // Returns 6. Name is the 6th field in the Address table.
        print id;
        pause;
    }

See also

fieldId2Name Function

fieldId2PName Function

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