use AOT query in code
static void Job10(Args _args)
{
CustInvoiceJour custInvoiceJour;
Query query = new Query(queryStr (InventJournalTrans)); // Query name.
QueryRun qr;
QueryBuildRange qbr;
InventJournalTrans inventJournalTrans;
MainAccount mA;
DimensionAttributeValueCombination dimensionAttributeValueCombination;
HcmWorker hcmWorker;
JournalError journalError;
InventDim inventDim;
// Find the InvoiceDate range on AOT Query.
qbr = query.dataSourceTable( tablenum (InventJournalTrans))
.findRange( fieldNum (InventJournalTrans, JournalId));
// We can check if the query range does exist, if not, we can create it.
if (!qbr)
{
qbr = query.dataSourceTable( tableNum (InventJournalTrans))
.addRange( fieldNum (InventJournalTrans, JournalId));
}
// Assigning query range value.
qbr.value('IJN006806');
// Executing our query.
qr = new QueryRun(query);
// Looping through query results.
while (qr.next())
{
// Assinging query results to table buffer.
inventJournalTrans = qr.get(tableNum(InventJournalTrans));
mA = qr.get(tableNum(MainAccount));
dimensionAttributeValueCombination = qr.get(tableNum(DimensionAttributeValueCombination));
inventDim = qr.get(tableNum(InventDim));
// Showing results.
info( strFmt ('%1 - %2 - %3' , inventJournalTrans.JournalId,
dimensionAttributeValueCombination.RecId,
inventDim.RecId));
}
No comments:
Post a Comment