How to group by a common table with a specific field?
I'm getting a syntax error on (dt.fieldname2Id('BatchNo'))
Here's my code:
Common common;
SysDictTable dt;
dt = SysDictTable::newName('Table1');
common = dt.makeRecord();
while select count(RecId) from common
group by common.(dt.fieldname2Id('BatchNo')) //syntax Error here
where common.(dt.fieldname2Id('flag'))==1
{
info(int642str(Common.Recid));
}
group bywith this method. You'll have to do what is suggested below. - Alex Kwitnyselectstatement and determine thegroup byfield. I think it usually expects only the field name and notTable.Field. If I'm right, then it's technically impossible unless you use Macros to define every possible table and have it switching around at runtime (yuck). - Alex Kwitny