从查找中选择项目ID时显示项目名称

时间:2023-01-19 10:08:20

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?

虚拟需要帮助:))))))我有一个空格,有2个字段,ItemId和ItemName,ItemId有查找键。当我从查找表中选择一些itemid以在另一个字段中显示其ItemName时,如何使它成为可能?

1 个解决方案

#1


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:

在AOT中的表上,覆盖modifiedfield方法。有关如何覆盖的示例,请检查purchline.modifiedField方法。只需在交换机中添加一个案例:

case fieldnum(YourTable, ItemId) this.itemName = inventtable::find(this.itemid).name(); break;

case fieldnum(YourTable,ItemId)this.itemName = inventtable :: find(this.itemid).name();打破;

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.

除非确实有必要,否则不需要同时添加itemId和itemName,因为您在此时要对数据库进行反规范化。最好将itemname的显示方法添加到网格中。

#1


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:

在AOT中的表上,覆盖modifiedfield方法。有关如何覆盖的示例,请检查purchline.modifiedField方法。只需在交换机中添加一个案例:

case fieldnum(YourTable, ItemId) this.itemName = inventtable::find(this.itemid).name(); break;

case fieldnum(YourTable,ItemId)this.itemName = inventtable :: find(this.itemid).name();打破;

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.

除非确实有必要,否则不需要同时添加itemId和itemName,因为您在此时要对数据库进行反规范化。最好将itemname的显示方法添加到网格中。