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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 08.08.2012, 03:41   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
emeadaxsupport: Auto conversion of enums to string error occurs when SysModelMetadata code runs in AX 2012 CIL
Источник: http://blogs.msdn.com/b/axsupport/ar...-2012-cil.aspx
==============

We recently came across an issue when we are interrogating the model metadata through a batch process (which uses CIL), in Microsoft Dynamics AX 2012/ 2012 Feature Pack. We get the following error:
The expected type was str, but the encountered type was enum.

The issue is isolated to the class SysModelMetaData. The new() method of this class instantiates two of its Map objects using the wrong data types for the map key value.

xRefKind2Concept = new Map(Types::String, Types::Class);
utilElementType2Concept = new Map(Types::String, Types::Class);

Changing the code as highlighted below, helps to workaround this error:



private void new()
{
concepts = new List(Types::Class);
groupingNodes = new List(Types::Class);
path2Image = new Map(Types::String, Types::Integer);
path2GroupNodeType = new Map(Types::String, Types::Enum);
xpoToken2Concept = new Map(Types::String, Types::Class);

/*
xRefKind2Concept = new Map(Types::String, Types::Class);
utilElementType2Concept = new Map(Types::String, Types::Class);

*/

xRefKind2Concept = new Map(Types::Enum, Types::Class);
utilElementType2Concept = new Map(Types::Enum, Types::Class);



//If the init mehtod isn't compiled ok, it will prevent the AOS from starting if invoked
if (new SysDictMethod(UtilElementType::ClassInstanceMethod, classNum(SysModelMetaData), methodStr(SysModelMetaData, init)).compiledOk())
{
this.init();
}
else
{
throw error(strFmt("@SYS86011", strFmt("%1.%2()", classStr(SysModelMetaData), methodStr(SysModelMetaData, init))));
}

super();
}



--author: Mansour Yahya Mohamad


Источник: http://blogs.msdn.com/b/axsupport/ar...-2012-cil.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: In Microsoft Dynamics AX 2012, compiler output setting of Message Window may cause errors when generating (incremental) CIL Blog bot DAX Blogs 0 16.03.2012 23:12
emeadaxsupport: 4. Solving Fill Utility errors on Microsoft Dynamics AX 2012 - Error executing code: Wrong argument types for comparison (another scenario) Blog bot DAX Blogs 2 08.02.2012 09:21
emeadaxsupport: 3. Solving Fill Utility errors on Microsoft Dynamics AX 2012 - Error executing code: Wrong argument types for comparison Blog bot DAX Blogs 1 08.02.2012 08:53
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
daxdilip: Whats New in Dynamics AX 2012 (A brief extract from the recently held Tech Conf.) Blog bot DAX Blogs 7 31.01.2011 12:35

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

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

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