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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 23.10.2008, 18:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
palleagermark: Finding unused labels
Источник: http://palleagermark.blogspot.com/20...ed-labels.html
==============

Here is a small job for finding labels, from a particular label file, that are not used in the application. You need an updated croess reference before running the job.
X++:
static void findUnXedLabels(SysOperationProgress _progress = null)
{
    Label           label       = new Label('da');  // The language to use for finding the labels
    str 250         labelId     = label.searchFirst('');
    Map             mapLabels   = new Map(types::String, types::String);
    MapEnumerator   mapEnumerator;
    ;

    setPrefix("Finding UnX'ed labels");
 
    while (labelId)
    {
        if (label.moduleId(labelId) == "XYZ") // The particular label file
        {
            if ((select xRefNames
                     index hint Name
                     where  xRefNames.Kind == xRefKind::Label &&
                            xRefNames.Name == labelId &&
                            xRefNames.TypeName == '').RecId == 0)
            {
                mapLabels.insert(labelId, label.extractString(labelId));
            }
        }
        labelId = label.searchNext();
    }

    // The maps is used to sort the lables
    mapEnumerator = mapLabels.getEnumerator();

    while (mapEnumerator.moveNext())
    {
        info (strFmt("%1 %2", mapEnumerator.currentKey(), mapEnumerator.currentValue()));
    }
}
In standard AX you can run this check for all labelfiles and save the result to a file, by using the \Classes\SysApplCheck\findUnXedLabels method.

Источник: http://palleagermark.blogspot.com/20...ed-labels.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
За это сообщение автора поблагодарили: kashperuk (5).
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
palleagermark: Dealing with changed table or field id's Blog bot DAX Blogs 0 11.02.2009 11:05
palleagermark: The book "Dynamics AX: A Guide to Microsoft Axapta" is available on Google Books Blog bot DAX Blogs 0 10.02.2009 15:05
palleagermark: Set focus on a particular field on an EP page Blog bot DAX Blogs 0 27.11.2008 14:05
epblog: Using AX Labels in EP 2009 Blog bot DAX Blogs 0 02.07.2008 00:07
axStart: version control with VSS by using Labels BETA Blog bot DAX Blogs 0 09.01.2008 04:34

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 10:14.