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

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...