How To Access Field In A Table Using This Field Id
To do this you could use the next construction:
vendTable.( filednum( vendTable, VendAccount ) ) = “XXX”;
This is the same as
vendTable.VendAccount = “XXX”;
Example:
Field VendAccount from VendTable has id 1. Then statement VendTable.(1) = “V-00014” – will initialize field VendAccount with value “V-00014”.
You could also use this feature while working with records of type Common.
Example:
Common common;
VendTable vendTable;
;
select vendTablewhere vendTable.VendAccount== "V-00014";
common = vendTable;
info( common.( fieldnum( vendTable
, VATNum) ) );