Sunday, July 3, 2016

QueryRun.changed in ax 2012

//queryRun.changed in ax 2012
Example :
1) CustTable
2) SalesTable
    Query                   query;
    QueryBuildDataSource    datasource;
    QueryRun                queryRun;
    int                     i= 0,
    ;
    query = new Query();
    datasource = query.addDataSource(tableNum(CustTable));
    datasource = datasource.addDataSource(tableNum(SalesTable));
    datasource.joinMode(JoinMode::OuterJoin);
    datasource.relations(true);
    datasource.addLink(fieldNum(CustTable, AccountNum),fieldNum(SalesTable, CustAccount));
    queryRun = new QueryRun(query);
    while (queryRun.next())
    {
        if (queryRun.changed(tableNum(CustTable)))
            i++;
    }
queryRun.changed(tableNum(CustTable));
//Above line return only when Customer table selecting next record

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...