我有以下情况:我需要加入 VendInvoiceJour.InvoiceAccount <- VendTable.AccountNum 并参加 VendTable.Vendgroup。在所有情况下(查询,甚至视图)Dynamics ax 连接表 VendInvoiceJour.OrderAccount<- VendTable.AccountNum 不是 VendInvoiceJour.InvoiceAccount <- VendTable.AccountNum。我正在尝试使用这种查询:
qBdSVendJour = element.query().dataSourceTable(tablenum(VendInvoiceJour));
qBdSVendTbl = qBdSVendJour.addDataSource(tablenum(VendTable));
qBdSVendTbl.relations(true);
qBdSVendTbl.joinMode(JoinMOde::InnerJoin);
qBdSVendTbl.fetchMode(QueryFetchMode::One2One);
qBdSVendTbl.addLink(
FieldNum(VendInvoiceJour,InvoiceAccount)
,FieldNum(VendTable,AccountNum)
); //(Dynamics ax automatically corrects InvoiceAccount to orderaccount
//in reports if trying this link in morphx)