static void Querywithrelations(Args _args)
{
Query q;
QueryBuildDataSource qbds , qbds1;
QueryBuildRange qbrAccNo,qbrName;
QueryRun qr;
CustTable custTable;
CustTrans custTrans;
;
q = new Query();
qbds = q.addDataSource(tableNum(CustTable));
qbds1 = q.addDataSource(tableNum(CustTrans));
qbrAccNo = qbds.addRange(fieldNum(CustTable,AccountNum));
qbds1.relations(true);
qr= new QueryRun(q);
if(qr.prompt())
{
while(qr.next())
{
custTable = qr.getNo(1);
custTable = qr.get(tableNum(CustTable));
custTrans = qr.getNo(2);
info(custTable.AccountNum);
info(strFmt("%1",custTrans.AmountCur));
}
}
else
{
throw error("Query execution cancelled");
}
}
{
Query q;
QueryBuildDataSource qbds , qbds1;
QueryBuildRange qbrAccNo,qbrName;
QueryRun qr;
CustTable custTable;
CustTrans custTrans;
;
q = new Query();
qbds = q.addDataSource(tableNum(CustTable));
qbds1 = q.addDataSource(tableNum(CustTrans));
qbrAccNo = qbds.addRange(fieldNum(CustTable,AccountNum));
qbds1.relations(true);
qr= new QueryRun(q);
if(qr.prompt())
{
while(qr.next())
{
custTable = qr.getNo(1);
custTable = qr.get(tableNum(CustTable));
custTrans = qr.getNo(2);
info(custTable.AccountNum);
info(strFmt("%1",custTrans.AmountCur));
}
}
else
{
throw error("Query execution cancelled");
}
}
No comments:
Post a Comment