Thursday 12 September 2019

How to get a unique record from a table without index in dynamics AX/D365 X++

Some times we need to find an unique record from a table. In this example I'm find an unique record based on created date time and grouping by salesId. Change the code according to your requirement.

Usually we use this format code when the primary index is not available in the table.


 while select maxof(LogCreatedDateTime) from SalesOrderLogView
                    join salesTable
                    group by SalesOrderLogView.SalesId
                     where  SalesOrderLogView.LogCreatedDateTime >= _fromdatetime
                                            && SalesOrderLogView.LogCreatedDateTime <= _todatetime

{
    info(SalesOrderLogView.salesID);
}

@Rahul

No comments:

Post a Comment

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...