X++ code to filter data from multiple table by using simple query(AOT Query)

 This code helps to filter the data from multiple table by using simple query

Code :-

class BAS_CustInvoiceJour

{

    /// <summary>

    /// Runs the class with the specified arguments.

    /// </summary>

    /// <param name = "_args">The specified arguments.</param>

    public static void main(Args _args)

    {

        SalesTable salestable;

        SalesLine saleline;

        CustInvoiceJour custinvoicejour;

        Query query = new Query(queryStr(BAS_CustInvoiceCustjour));

        QueryRun queryrun = new QueryRun(query);

        if(queryrun.prompt())

        {

            while(queryrun.next())

            {

                salestable = queryrun.get(tableNum(SalesTable));

                saleline = queryrun.get(tableNum(SalesLine));

                custinvoicejour = queryrun.get(tableNum(CustInvoiceJour));

                info(strFmt("Cust id is %1 Lineamount %2 and Incoiced amount %3",salestable.SalesId,saleline.LineAmount,custinvoicejour.InvoiceAmount));

            }


        }

    }



Comments

Popular posts from this blog

How to Create a wizard in x++ d365

how to post trade agreement journals automatically using x++ code

X++ code to CREATE AND POST A TRADE AGREEMENT IN MICROSOFT DYNAMICS 365 in D365 F & O