Hi everyone,
i built a query in SQL Management Studio and now i'm trying to realize this query in a form.
This is the query:
select * from VENDPACKINGSLIPTRANS
join INVENTTRANSORIGIN on
(INVENTTRANSORIGIN.INVENTTRANSID = VENDPACKINGSLIPTRANS.INVENTTRANSID)
join INVENTTRANS on
(INVENTTRANS.INVENTTRANSORIGIN = INVENTTRANSORIGIN.RECID
and INVENTTRANS.PACKINGSLIPID = VENDPACKINGSLIPTRANS.PACKINGSLIPID
where VENDPACKINGSLIPTRANS.QTY > 0
and INVENTTRANS.STATUSRECEIPT = 2
and INVENTTRANS.STATUSISSUE = 0
and INVENTTRANS.INVOICEID = ''
I have problems to implement the marked link in AX.
This is the (unfinished) AX-Query:
qbds = this.queryBuildDataSource();
qbds.addRange(fieldNum(VendPackingSlipTrans, Qty)).value(SysQuery::valueNot(0));
qbds = qbds.addDataSource(tableNum(InventTransOrigin));
qbds.addLink(fieldNum(VendPackingSlipTrans, InventTransId),
fieldNum(InventTransOrigin, InventTransId));
qbds.joinMode(JoinMode::ExistsJoin);
qbds = qbds.addDataSource(tableNum(InventTrans));
qbds.relations(false);
qbds.clearDynalinks();
qbds.addRange(fieldNum(InventTrans, StatusReceipt))
.value(queryValue(StatusReceipt::Received));
qbds.addRange(fieldNum(InventTrans, StatusIssue))
.value(queryValue(StatusIssue::None));
qbds.addRange(fieldNum(InventTrans, InvoiceId)).value(queryValue(''));
qbds.addLink(fieldNum(InventTransOrigin, RecId),
fieldNum(InventTrans, InventTransOrigin));
//qbds.addLink(fieldNum(VendPackingSlipTrans, PackingSlipId),
// fieldNum(InventTrans, PackingSlipId));
qbds.joinMode(JoinMode::ExistsJoin);
The query works except for the marked fragment. I wonder how to implement this link.
Any ideas?
Regards
Nils
*This post is locked for comments