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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 24.11.2011, 11:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,497 / 847 (79) +++++++
Регистрация: 28.10.2006
daxdilip: Tip - How to Retrieve AOS Instance name in Dynamics AX via X++ Code
Источник: http://feedproxy.google.com/~r/blogs...ance-name.html
==============
One of my mates asked me how to retreive AOS Instance name through code. My first impression was that it should be somewhere in the Global Class. But, soon figured out I was wrong, then I jumped into Session Class which has a static method getAOSInstance() which retreives the instance number

The requirement here was to extract the instance name. Suddenly, it striked me, that in standard AX in Administration > Online Users form, the last column shows the AOS instance name.

So, the next step was to go through AOT > Forms > SysOnlineUsers > display method getAOSInstanceName() - here the key is serverSessions.aosId and serverSessions.Instance_Name - combination of both will give you the aos instance.

X++:
//BP Deviation documented
display ServerId getAOSInstanceName(SysServerSessions serverSessions)
{
    ServerId            sid = '';
    str                 aosId, machineName, instanceName;
    int                 pos;
    #DEFINE.ATSYMBOL('@')
    ;
    aosId = serverSessions.aosId;
    instanceName = serverSessions.Instance_Name;    pos = strfind(aosId, #ATSYMBOL, 1, strlen(aosId));
    machineName = substr(aosId, 1, pos-1);
    sid = instanceName + '@' + machineName;
    return sid;
}
Sometimes Googling within AX helps Njoi ;-)



Источник: http://feedproxy.google.com/~r/blogs...ance-name.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.

Последний раз редактировалось Poleax; 24.11.2011 в 11:25. Причина: оформление
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22: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
emeadaxsupport: How does the Dynamics AX Setup detect existing AOS Instances? Blog bot DAX Blogs 0 06.07.2010 17:05
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05

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

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

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