web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

ORDERBY Function in ER

(3) ShareShare
ReportReport
Posted on by 6
Hi,
 
I have an ER configuration with an invoice line range. I want to sort the lines by line number. I tried using ORDERBY function but it is not working as expected. Here's an example of the current report:
And here's the invoice lines in F&O:
 
As you can see, the report is not sorted by Line number.
 
I tried putting ORDERBY in the range in ER configuration:
 
But here's the result:
 
Can you please teach me how to fix this as I am new to ER.
 
Thank you in advance!
Categories:
I have the same question (0)
  • CU31030925-0 Profile Picture
    2 on at
    Have you got the solution?
  • ERZeppelin Profile Picture
    47 on at
    I would start with creating calculated field in your mapping, that contains your ORDERBY expression. Then you should map it to your range InvoiceLines, not InvoiceLines_Values. What is happening here: currently the elements are iterated on upper level (InvoiceLines) on non sorted list of lines, but then on lower level you are ataching ORDERBY clause, which is filling only first record from all ordered lines. To visualise - with your mapping you have an output:
    1) model.LineItem.Line1 for line range, ORDERBY(model.LineItem).Line1 for values
    2) model.LineItem.Line2 for line range, ORDERBY(model.LineItem).Line1 for values
    3) model.LineItem.Line3 for line range, ORDERBY(model.LineItem).Line1 for values
    .....
     
    That happens, because on every line - clause ORDERBY is iterated from the beginning. Because only first record from ORDERBY is taken - your values are repeating over all rows.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 681

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 448 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 218 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans