AX / D365FO – Get Table field value by field id

I know table name and  table field name as string .

For example  Table1 and fieldName “code” as string

I want to get the value of this field from database .

How can i  get this information ?

You can solve by following this example

int fieldID = fieldName2Id(tableName2Id("MyTableName"), "FieldName");

str valueStr = MyTable.(fieldID)
 //you are getting  value in valueStr field.

Leave a comment