static void krishh_ExpressionInQuery(Args _args)
{
Query q = new Query();
QueryRun qr;
CustTable ct;
QueryBuildDataSource qbr1;
;
qbr1 = q.addDataSource(tablenum(CustTable));
qbr1.name("Customer");
qbr1.addRange(fieldNum(CustTable, AccountNum)).value(
strFmt('((%1.%2 == "4000") || (%1.%3 == "The Bulb"))',
qbr1.name(),
fieldStr(CustTable, AccountNum),
fieldStr(CustTable, Name)));
info(qbr1.toString());
qr = new QueryRun(q);
while (qr.next())
{
if (qr.changedNo(1))
{
ct = qr.getNo(1);
info(strfmt('CustomerAccountNum=%1 And Customer Name=%2',ct.AccountNum,ct.Name));
}
}
}
{
Query q = new Query();
QueryRun qr;
CustTable ct;
QueryBuildDataSource qbr1;
;
qbr1 = q.addDataSource(tablenum(CustTable));
qbr1.name("Customer");
qbr1.addRange(fieldNum(CustTable, AccountNum)).value(
strFmt('((%1.%2 == "4000") || (%1.%3 == "The Bulb"))',
qbr1.name(),
fieldStr(CustTable, AccountNum),
fieldStr(CustTable, Name)));
info(qbr1.toString());
qr = new QueryRun(q);
while (qr.next())
{
if (qr.changedNo(1))
{
ct = qr.getNo(1);
info(strfmt('CustomerAccountNum=%1 And Customer Name=%2',ct.AccountNum,ct.Name));
}
}
}
Hi krish,
ReplyDeletei need C# version of this code for date fields
please send me
balachandargopal@gmail.com
Thanks
Balachandar G