Thursday, September 12, 2019

Get the last inserted record from table in Dynamics AX/D365 using x++

Sometimes we get a requirement to get latest inserted record from a table in dynamics AX.
Below is an example code for that. Here, I used order by desc to get the latest record.

select firstfast salesTable order by CreatedDateTime desc where salesTable.CustAccount == custTable.AccountNum
                    && salesTable.SalesType == SalesType::Sales
                    && salesTable.SalesStatus != SalesStatus::Canceled;

@Rahul

No comments:

Post a Comment

Power Automate vs Azure Logic Apps vs Azure Data Factory: What They Are, When to Use Them, and How to Integrate Non-Microsoft Systems

  In today’s cloud-first, API-driven enterprise landscape, automation and integration have become vital pillars of operational agility. Micr...