AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
DAX
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 15.10.2008, 02:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,487 / 846 (79) +++++++
Регистрация: 28.10.2006
Dynamics AX: Map Object Sorting - a real issue
Источник: http://dynamics-ax.blogspot.com/2008...eal-issue.html
==============
Alright,

So I am sure everyone has used Map objects in writing X++ code before. Map's are part of Collection classes that exist inside Dynamics AX.

Well one of the strangest things about this Collection class, is that it's lack or sorting methods. It does not have any. You can't sort a Map object by values or Keys, and if you can, it's buried so deep that no one has wrote about it or found it.

What kind of sorting I did see today, with my partner in crime Derek Pate, was based on the Type for the Key value of the map.

For example, say you have:

3,4,5,6,7,8,10,12,14,16

as values. Now if these values are integer based from the source your pulling from or you convert to, and you take and insert these values as listed with some form of while loopping on the object that carried these values for you, sorted in the above way, you would expect these to appear in the object your inserting too, in that same sorted order. Right?

Wrong!

If you are trying to insert the above values, of type integer, into a Map of Types::String, Types::String you will end up with the following sorted values for that Map's value elements:

"10","12","14","16","3","4","5","6","7","8"

So even though there is not a known / published sorting method or built-in function for sorting a Map, it tries to automatically sort the values for you based on type, even though you inserted those values into the map object the order desired.

This is one of those strange things that exists, that should not actually. The ability to sort, and sorting to exist for the developer at hand. Not a guessed sorting order, based on type.

Maybe an improvement suggestion? Have you seen this before? Do you have a sorting method you like to use for Map Object Values? Let me know here... and check back soon!




"Visit the Dynamics AX Community Page today!"




==============
Источник: http://dynamics-ax.blogspot.com/2008...eal-issue.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
За это сообщение автора поблагодарили: TasmanianDevil (-1).
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dynamics AX: Managing Your Supply Chain Using Microsoft Dynamics AX 2009 - Book Review Blog bot DAX Blogs 0 31.03.2009 23:06
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
AX Developer tips: Dynamics AX Performance issue. Cross object references drawbacks. Blog bot DAX Blogs 0 14.07.2008 00:11
Inside Dynamics AX 4.0: Usage Scenarios Blog bot DAX Blogs 0 04.10.2007 05:15
Dynamics AX: Why Dynamics AX beats SAP Blog bot DAX Blogs 0 10.01.2007 23:15

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 20:10.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.