Hi Experts,
I have one table named "RetailTransactionTable".
In this table we have different customer account.
I want to calculate net amount based on different customers account through Query classes.
I tried like this:
#OCCRetryCount
Query query;
QueryRun queryRun;
QueryBuildDataSource qbds;
QueryBuildRange queryRange;
RetailTransactionTable retailTransactionTable;
real netTotalAmount;
Integer noOfCustomer = _CustomerTransactionContract.parmNoOfCustomer();
query = new Query(SysOperationHelper::base64Decode(_CustomerTransactionContract.parmQuery()));
queryRun = new QueryRun(query);
while (queryRun.next())
{
try
{
qbds = query.dataSourceTable(tableNum(RetailTransactionTable));
qbds.addSelectionField(fieldNum(RetailTransactionTable,netAmount),SelectionField::Sum);
retailTransactionTable = queryrun.get(tableNum(RetailTransactionTable));
}
catch (Exception::Deadlock)
{
retry;
}
}
info(strFmt("%1",netTotalAmount));
}
Please suggest me the right path
Thanks
Sona Jee