Sort Swedish Alphabet and English Alphabet in X++ code
In X++, the only two ways I see are direct SQL and sorting in the application layer. If you don't have to do it in X++ and you can use, say, a report, you have some extra options.
Regarding direct SQL, a better alternative to do the whole query there may be creating view with a computed column and using ROW_NUMBER() OVER.
Sort Swedish Alphabet and English Alphabet in X++ code
Hi Martin,
Thanks a much for your response.
Could you please explain it more what you mean by this statement-
It's also possible to use a different collation for a query (ORDER BY COLLATE), but there is no support for it (AFAIK) in F&O, therefore you'd need a direct SQL statement. You can also request such a feature.
Martin Dráb230,488Most Valuable Professional
on at
Sort Swedish Alphabet and English Alphabet in X++ code
Sorting rules are defined by the collation used by the database server.
One option is just accepting the situation, even if you don't like it.
Another would be changing the DB collation, if Microsoft allows it (you can't do it in production on your own). But it would still be a problem if you have users that don't use Swedish. And even if you don't have today, your company can expand tomorrow.
It's also possible to use a different collation for a query (ORDER BY COLLATE), but there is no support for it (AFAIK) in F&O, therefore you'd need a direct SQL statement. You can also request such a feature.
The last option is fetching all values from database and then sorting them in the application layer, where you can do whatever you want.
Maybe someone has more ideas...
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.