Dummy needs a help : )))))
I have an empty Grid with 2 fields, ItemId and ItemName, ItemId has lookup key.
How to make it possible when I select some itemid from lookup table to show its ItemName in another field?
Asked
Active
Viewed 3,113 times
1 Answers
2
On your table in the AOT, overwrite the modifiedfield method. For an example on how to overwrite, check the purchline.modifiedField method for example. Just add a case in the switch:
case fieldnum(YourTable, ItemId) this.itemName = inventtable::find(this.itemid).name(); break;
Unless really necessary, adding both the itemId and itemName is not needed, as you are de-normalizing the database at the point. It is probably better to add a display method for the itemname to your grid.

Klaas Deforche
- 1,151
- 5
- 9
-
Thanks, it works perfectly. I have one more question. Is it possible to do this task without code or not? – Feb 04 '14 at 10:32
-
The name of the item is retrieved using the inventtable.name() method, so you need to call that method to retrieve it. I can't think of a way to do it without code. Personally, I would use a display method here and not add a field to the table, and you certainly need code for that. – Klaas Deforche Feb 04 '14 at 10:45