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