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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.03.2010, 21:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,574 / 848 (80) +++++++
Регистрация: 28.10.2006
emeadaxsupport: Identifying damaged Table objects in the AOT MetaData
Источник: http://blogs.msdn.com/emeadaxsupport...-metadata.aspx
==============

It happens very seldom, but sometimes the AOT MetaData is getting damaged, especially for Table objects.

Indications of such an element “corruption” can be that you have one explicit Table in the AOT and every time you access this object either the Dynamics AX Client or the Dynamics AX Application Object Server crashes. But the issue can also start earlier when you expand the Data Dictionary node of the AOT.

If you have no idea what Table could be affected the following X++ Job can help you finding out, by walking through the UtilIdElements Table touching each individual Table object:

X++:
static void findDamagedTableObjects(Args _args) 
{ 
    UtilIdElements util; 
    common tabBuff; 
    DictTable dt; 
    ; 

    //Look at all Tables 
    while select util where util.recordType == utilElementType::Table 
    { 
        /* Print out the name; the last element showing up here is 
           most likely the object causing issues... */ 
        print strFmt('Layer: %1 | Table Id: %2 | Table Name: %3', 
           util.utilLevel, util.id, util.name); 

        //This will eventually cause the Client or AOS to crash 
        dt = new DictTable(tablename2id(util.name)); 
        tabBuff = dt.makeRecord(); 
    } 

    print 'Completed without error!'; 
    pause; 
}
The Job accesses all Table Objects and lists them in the Print window. When the damaged element is reached the operation is stopped (e. g. because the AOS is crashing) so the last object showing up in the Print window is most likely the one causing the trouble.

Once you know the Table object causing issues, you could try deleting the object programmatically with the following X++ Job:

X++:
static void deleteDamagedTableObject(Args _args) 
{ 
    UtilIdElements utilElement; 
    UtilElementName tableName; 
    UtilEntryLevel tableLayer; 
    ; 
    
    /********************************************************************/ 
    /* Please adjust to the Table Name and Table's Layer to be removed! */ 
       tableName = 'NameOfDamagedTableToBeRemoved'; 
       tableLayer = utilEntryLevel::usr; 
    /********************************************************************/ 
    
    ttsbegin; 
    select utilElement where utilElement.name == tableName 
       && utilElement.utilLevel == tableLayer 
       && utilElement.recordType == utilElementType::Table; 
    
    if (utilElement) 
    { 
        utilElement.delete(); 
        ttscommit; 
    
        info(strFmt('Table object %1 in Layer %2 has been deleted!', tableName, tableLayer)); 
    } 
    else 
    { 
        ttsAbort; 
    
        warning(strFmt('Table object %1 in Layer %2 was not found!', tableName, tableLayer)); 
    } 
}
If attempting to delete the Table object with the previous X++ Job fails in any way, it will be necessary to rebuild the layer the damaged object is existing.

One possibility to rebuild a damaged layer is:
  1. Create a new Project in the AOT
  2. Specify a filter for all elements from the affected layer (don't use any grouping here, as this could again cause a crash)
  3. Create another new Project and manually move all non-damaged objects from the first Project to the the other
  4. Export the second Project as XPO (with IDs)
  5. Stop the AOS and delete the damaged Layer’s AOD file (and AOI)
  6. Start the AOS again
  7. Re-import the XPO to the same Layer (now the corrupt object is gone)


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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: Renaming an AOT object in Dynamics AX 2009 that is under source control with Team Foundation Server Blog bot DAX Blogs 0 06.10.2009 02:05
emeadaxsupport: Group policy setting "System Objects: Default owner for objects created by members of the administrators group" is missing on Windows Server 2008 Blog bot DAX Blogs 2 28.08.2009 02:14
SysDictCoder: Changing properties of AOT objects in code Blog bot DAX Blogs 0 04.05.2009 20:05
To find objects in AOT with particular properties Blog bot DAX Blogs 1 26.04.2008 07:33
C# and AX Development: How to delete AOT objects (AX/Axapta) Blog bot DAX Blogs 0 13.12.2007 19:50

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

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

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