Orda - For Each Syntax -> ordered entity selection

Using this format

For each (Historyemp; ds.Lets.query (“CaseNumber = :1”;$TheCasenumber))
Do something
End for each

How do you modify the expression to make the entity selection specifically ordered. I have been looking at the online docs for ages without seeing the light.

Thanks for your help again.

Perhaps

For each (Historyemp; ds.Lets.query (“CaseNumber = :1”;$TheCasenumber).orderBy( ))
  // Do something
End for each

or .orderByMethod( )
or .sort( )

3 Likes

Perfect. Thank you. The documentation could do with being just a little more richly illustrated! and when I get a moment I will look at the conference videos.

Merci beaucoup

You can use the ORDER BY command directly in the query statement:

For each (Historyemp; ds.Lets.query (“CaseNumber == :1 ORDER BY someField asc”;$TheCasenumber))
Do something
End for each
3 Likes

A very useful works here. Thanks to Cannon.

3 Likes