The task is to show sorted values in a form but the sorting isn’t ascending or descending. Let’s say that there is a field called Group. This field can have only 3 values they are all str: A, B and C. These values must be sorted in this order: B, A, C.
Also, the second field which will be used for sorting is Date field.
And finally, if Group field has value C, then the sorting in these records should happen by field Type: Type can have only 2 values: X and Y, both of them are str. The order must be: X, Y.
What is the easiest algorithm that can be used to implement the given task in AX 2009? Obviously alphabetical orders can’t be used. I’m thinking and Union queries come to mind, any advices?