Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Wednesday, February 25, 2015

QueryDataSourceLink in AX

Hi,

static void AlfasithQueryDataLink(Args _args)
{
    Query                   query;
    QueryBuildDatasource    datasource;
    ;

    query = new Query();

    datasource = query.addDataSource(tableNum(CustInvoiceJour));// Add Parent table

    datasource = datasource.addDataSource(tableNum(CustInvoiceSalesLink)); // Add child table

    datasource.joinMode(JoinMode::InnerJoin);       // Mode of join

    datasource.relations(false);        // Indicate you don't want to use relations DynamicLink

 
    datasource.addLink(fieldNum(CustInvoiceJour, SalesId),
        fieldNum(CustInvoiceSalesLink, SalesId));     // Add link between parent field and child field

    info(query.xml());
}

Regards,

No comments:

Post a Comment

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...