I have created a aot query as DeliveryNotegroup which consists one table and I have selected
static void Job203(Args _args)
{
Query q = new Query(queryStr (DeliveryNotegroup));
;
QueryRun qr;
QueryBuildDataSource qbd;
SON_AttachmentELMOInvoice SON_AttachmentELMOInvoice;
QueryBuildRange qbr;
qbd = q.addDataSource(TableNum(SON_AttachmentELMOInvoice));
qbr = qbd.addRange(FieldNum(SON_AttachmentELMOInvoice, SummaryInvoiceNumber));
qbr.value(("17620191"));
qr = new QueryRun(q);
while(qr.next())
{
SON_AttachmentELMOInvoice = qr.get(tableNum(SON_AttachmentELMOInvoice));
info(strFmt("%1",SON_AttachmentELMOInvoice.RecId));
}
}
actually in the AOT query I have only one table if the table has 70 records when i run the while(qr.next()) it returns 70 records with their rec id and 70 blanks records so the query run runs for 140 times for 70 records
I find one thing find that when create the dynamics query with querybuild without aot query it returns correct value. only 70 records and which is correct
*This post is locked for comments