我试图在创建的网格中加入多个数据源。 网格处于CaseDetail形式,它使用与其上一些其他组相同的表格。 因此,我必须使用基于数据源名称的连接而不是表名。按名称在AX 2012中加入数据源表格
有InventTable(InventTableComplaints) - 父母和EcoResProductTranslation(EcoResProductTranslationComplaints) - 孩子。
我想要做的就是这段代码添加到子数据源:
public void executeQuery()
{
QueryBuildDataSource qbdsIT, qbdsERPTC;
qbdsIT = InventTableComplaint_DS.queryBuildDataSource();
qbdsERPTC = qbdsIT.addDataSource(tableNum(EcoResProductTranslation), "EcoResProductTranslationComplaint");
qbdsERPTC.addLink(fieldNum(InventTable, Product), fieldNum(EcoResProductTranslation, Product));
qbdsERPTC.joinMode(JoinMode::OuterJoin);
qbdsERPTC.fetchMode(QueryFetchMode::One2One);
super();
}
但它不工作。 这可能吗?
看起来你正在做'addDataSource'来添加另一个数据源,当它已经存在于表单上时。 –