web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Dynamics AX training / How to access field in a ta...

How to access field in a table using this field id

VolodymyrMy Profile Picture VolodymyrMy

To do this you could use next construction:

myTable.( filednum( myTable, myField ) ) = “XXX”;

This is the same as

myTable.myField = “XXX”;

Example:

Field AccountNum from CustTable have id 1. Then statement CustTable.(1) = “4000” – will initialize field AccountNum with value “4000”.

You could also use this feature while working with record of type Common.

Example:

    Common      common;
    CustTable    custTable;
    ;
    select custTable where custTable.AccountNum == "4000";
    common = custTable;
    info( common.( fieldnum( custTable, Name ) ) );

The output of running this code will be the info log with a message “Light and Design”, Where “Light and Design” – name of the customer with id “4000″.


This was originally posted here.

Comments

*This post is locked for comments