Friday, 8 June 2012

How to access field in a table using this field id


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″.


Copied from Experts website....... Dynamicsaxtraining.
You can always reach me at axapta4all@gmail.com
Anonymous Axaptian   

1 comment: