0

I can get a value from a .net data table that has columns named "Col1" and "Col2" like this:

DataTable dt = new DataTable() 
// some more code that fills it
Console.Writeline("{0}, {1}", dt.Rows[0]["Col1"], dt.Rows[0]["Col2"]);

I could also use a variable if my datatable has a lot of columns

string x = // something that will be one of the columns in the table
dt.Rows[i][x] = "Some new value"

Is anything like this possible in NAV with a Record variable?

1 Answers1

0

Well "like" this but not exactly. You can use RecordRef type to get reference to a field. But to interact with the certain field you will still need to adress it by its field number. You can iterate through all fields in the table and check their names to find the one you need. Not performant though.

Mak Sim
  • 2,148
  • 19
  • 30