General X++ Development
How do I get records from a QueryRun in X++?
How do I get records from a QueryRun in X++?
1 answer
Write an answerCall next() to advance the query and get() to retrieve the buffer for a datasource.
QueryRun queryRun = new QueryRun(query);
while (queryRun.next())
{
CustTable custTable = queryRun.get(tableNum(CustTable));
info(custTable.AccountNum);
}For multi-datasource queries, call get() with the table ID for the datasource buffer you need.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer