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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 24.10.2009, 16:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
Solutions Monkey: Add all Role Centers to AX Client Favorites for demo purpose
Источник: http://blogs.msdn.com/solutions/arch...o-purpose.aspx
==============
Run this job in AX Client to add all oob role centers to your favorites section in AX Client for easy demo purpose.

X++:
static void AddRoleCentersToFavorite(Args _args)
{
str sDefault ="Default";
SysProfiles uprofile;
MenuFunction mf;
TreeNode treeNode;
    TreeNodeIterator iterator;
    TreeNode newTreeNode;
    UserMenuList userMenu;
    Menu menuNode;
    #AOT
;

 treeNode = infolog.userNode();
    iterator = treeNode.AOTiterator();
    treeNode = iterator.next();
    if (treeNode)
    {
        userMenu = treeNode;

        // find 'My Favorites' user menu; if not found, create one
        treeNode = userMenu.AOTfindChild("@SYS95713");
        if (!treeNode)
        {
            userMenu.createMenu("@SYS95713");
            treeNode = userMenu.AOTfindChild("@SYS95713");
        }
        menuNode = treeNode;

while select ProfileId from uprofile
{

mf = new MenuFunction("DemoRoleCenter"+uprofile.ProfileId,MenuItemType::Action);
mf.AOTsetProperty("Label",uprofile.ProfileId);
mf.AOTsetProperty("ObjectType","Class");
mf.AOTsetProperty("Object","SwitchRoleCenter");
mf.AOTsetProperty("Parameters",uprofile.ProfileId);

mf.AOTsave();
menuNode.addMenuitem(mf);
menuNode.save();
}

mf = new MenuFunction("DemoRoleCenter"+sDefault,MenuItemType::Action);
mf.AOTsetProperty("Label",sDefault);
mf.AOTsetProperty("ObjectType","Class");
mf.AOTsetProperty("Object","SwitchRoleCenter");
mf.AOTsetProperty("Parameters",sDefault);

mf.AOTsave();
menuNode.addMenuitem(mf);
menuNode.save();


        infolog.navPane().refreshFavorites("@SYS95713");

    }
}


==============
Источник: http://blogs.msdn.com/solutions/arch...o-purpose.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
Теги
ax2009, favorites, role center, избранное, профиль пользователя, создание из кода, ролевой центр

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Solutions Monkey: Microsoft Dynamics AX 2009 Enterprise Portal / Role Centers - Deployment Tips-n-Tricks – 3 Blog bot DAX Blogs 0 27.10.2008 08:05
Solutions Monkey: Microsofty Dynamics AX 2009 Enterprise Portal / Role Centers - Deployment Tips-n-Tricks - 2 Blog bot DAX Blogs 0 30.09.2008 07:07
Solutions Monkey: Microsofty Dynamics AX 2009 Enterprise Portal / Role Centers - Deployment Tips-n-Tricks - 1 Blog bot DAX Blogs 0 26.06.2008 09:05
Solutions Monkey: Role Centers in Microsoft Dynamics Ax Blog bot DAX Blogs 0 26.06.2008 09:05
Solutions Monkey: Convergence 2008 - Microsoft Dynamics AX Enterprise Portal and Role Centers Blog bot DAX Blogs 0 09.03.2008 17:07

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

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

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