RE: QueryBuildDatasource is null
thank you for your answer John.
in fact, i would like to read all data in InventTransferTable with the input parameters (fromDate_Period1,toDate_Period1,...) and add range. But the qbds is alway null, i don't know why ?
if i change InventTransferTable by SalesLine the code below works :
qr = new QueryRun("InventTransferTable");
qbds = qr.query().dataSourceTable(tablenum(InventTransferTable));
qbdrInventTransferStatus = qbds.addRange(fieldnum(InventTransferTable,TransferStatus));
qbdrSalesStatus.value(queryValue(InventTransferStatus::Created));
qbdrShipDate = qbds.addRange(fieldnum(InventTransferTable,ShipDate));
if (fromDate_Period1 || toDate_Period1)
{
qbdrShipDate.value(SysQuery::Range(fromDate_Period1, toDate_Period1));
}
else
{
qbdrShipDate.value(SysQuery::valueUnlimited());
}
if(myGplELCCarrierName!="")
{
qbdrGPLELCCarrierName = qbds.addRange(fieldnum(InventTransferTable,GPLELCCarrierName));
qbdrGPLELCCarrierName.value(queryValue(myGplELCCarrierName));
}
while(qr.next())
{
myInventTransferTable = qr.get(TableNum(InventTransferTable));
}