Friday, 27 May 2016

Latest Record From Table

JOB:

To get some in between records from a table:

static void LatestInvoiceId()
{
    CustInvoiceJour     custInvoiceJour;
    int i;
   
    while select * from custInvoiceJour
        order by custInvoiceJour.InvoiceDate desc
            where custInvoiceJour.OrderAccount == "A003"  // CustAccount or OrderAccount
    {
        i++;
        if(i<6)
    info(strFmt("%1",custInvoiceJour.InvoiceId));
    }
}
******************************
To get a specific record from a table:

 static void LatestInvoiceId()
{
    CustInvoiceJour     custInvoiceJour;
  
     select * from custInvoiceJour
        order by custInvoiceJour.InvoiceDate desc
            where custInvoiceJour.OrderAccount == "A003" ;// CustAccount or InvoiceAccount or OrderAccount
  
    info(strFmt("%1",custInvoiceJour.InvoiceId));
 
}






No comments:

Post a Comment

Excel data connector in AX7/D365

Excel data connector in AX7: Configuring and using the Excel Data Connector Add-in The Excel Data Connector add-in is built by usi...