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

What is the primary purpose of using a Solution in Microsoft Power Platform & ALM?

As organizations embrace low-code development with Microsoft Power Platform , it becomes essential to manage and govern apps, flows, and dat...