as you might know, this is a nice way to dynamically set values to fields.
myTable.(fieldName2Id(myTable.TableId, fieldNameStr)) = "This value";
myTable.insert();
What I am wondering about is if there is any way to do it in a similar fashion with display methods, just dynamically get the values from them?
If i have the Display method name (i.e. itemName()) how can I do this...? something like this to demonstrate how i think:
methodNameStr = "ItemName";
myTable.myField = mytable.(methodName2Id(myTable.TableId, methodNameStr));
myTable.insert();
Use DictTable.callObject
(medhodName, buffer).
Common myTable;
DictTable dt;
//<SampleOnly>
str methodNameStr = "itemDescriptionOrName";
InventTable tmpTab;
select firstOnly tmpTab;
myTable = tmpTab;
//</SampleOnly>
dt = new DictTable(myTable.TableId);
dt.callObject(methodNameStr, myTable);
info(strFmt("%1", dt.callObject(methodNameStr, myTable)));