Reputation: 1581
I need to insert an another datasource on Query promt .
I saw there is a class SalesFormletterParmData and SalesFormletterParmDataInvoice but if I insert in method SalesFormletterParmDataInvoice\updateQueryBuild
qbds = chooseLines.query().addDataSource(tableNum(CustPackingSlipJour));
qbr = SysQuery::findOrCreateRange(qbds, fieldNum(CustPackingSlipJour, PackingSlipId));
But not filder anything. I want to have the data source added in query everytime loollike this, but bu code:
there is a way ?
Thanks.
Upvotes: 0
Views: 195
Reputation: 2281
It doesn't work because you are trying to add a datasource to the top level of the query:
qbds = chooseLines.query().addDataSource(tableNum(CustPackingSlipJour));
Modify your code as following:
qbds = chooseLines.query().dataSourceTable(tableNum(SalesTable)).addDataSource(tableNum(CustPackingSlipJour));
qdbs.joinMode(JoinMode::ExistsJoin);
qbds.relations(true);
qbr = SysQuery::findOrCreateRange(qbds, fieldNum(CustPackingSlipJour, PackingSlipId));
This will give the expected result
Please take into account that in standard AX if you set Quantity to Delivery note in parameters you will be able to choose Delivery notes in new window, or add query criteria using Select button
Upvotes: 1