【问题标题】:Can we use two source table or more in a page or in page extension in AL BC365?我们可以在 AL BC365 的页面或页面扩展中使用两个或更多源表吗?
【发布时间】:2019-08-19 21:25:34
【问题描述】:
我创建了一个扩展 "item card" 的页面扩展,现在我在这里要做的是 我有一个 table 我创建了,并希望访问该表在这个页面扩展中的字段。。 p>
基本上问题是 "item card" 页面已经有 "item" 作为其源表,我还想访问我的表在此页面中的字段扩大。有没有办法做到这一点?
我是 Microsoft Business Central 365 AL Development 的新手。所以,请帮帮我。
【问题讨论】:
标签:
dynamics-business-central
【解决方案1】:
您需要在页面扩展中为您的表定义一个局部变量。
然后使用触发器 OnAfterGetRecord(也在您的页面扩展中)检索与当前项目对应的自定义表中的记录。
如果您的自定义表中的主键是项目编号,则类似这样的内容(我尚未测试过):
trigger OnAfterGetRecord();
begin
MyTable.Get("Item No.")
end;
var
MyTable: table "My Table";