Hi all …
i want to pass the cust group ASAP-3000 in rage to skip the values of qty for item on date which is coming under this group customers … so i tried this logic … but i m getting this error …
1:N Fetch Mode is not allowed on Datasource having join condition with node other than its immediate parent.
private void buildAsOfQuery()
{
QueryBuildDataSource qbdsInventView;
QueryBuildDataSource qbdsSalesLine;
this.buildCommonQuery();
qbdsInventView = qbds.addDataSource(tableNum(InventValueReportView));
//--------- newly added for customization to avoid the cust group
query.allowCrossCompany(true);
qbdsSalesLine = qbds.addDataSource(tableNum(SalesLine));
qbdsSalesLine.addLink(fieldNum(InventValueReportView, InventTransId),fieldNum(SalesLine, InventTransId));
qbdsSalesLine.addRange(fieldNum(SalesLine, CustGroup)).value(SysQuery::valueNot(“ASAP-3000”));
//-------------
qbdsInventView.addLink(fieldNum(InventTable, ItemId), fieldNum(InventValueReportView, ItemId), qbdsInventTable.name());
qbdsInventView.addRange(fieldNum(InventValueReportView, TransDate)).value(queryRange(contract.parmAsOnDate() + 1, dateMax()));
qbdsInventView.orderMode(OrderMode::GroupBy);
qbdsInventView.addSelectionField(fieldNum(InventValueReportView, Qty), SelectionField::Sum);
if (buildAsOfQtyAndAmountQuery)
{
qbdsInventView.addSelectionField(fieldNum(InventValueReportView, Amount), SelectionField::Sum);
}
if (!inventDimParm.isAllFlagNo() || this.contractHasRange(tableNum(InventDim)))
{
qbds = this.addInventDim(qbdsInventView, fieldNum(InventValueReportView, InventDimId));
}
}