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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 26.01.2008, 18:22   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Ruslan Goncharov: Sending message to user
Источник: http://rusgon.blogspot.com/2008/01/s...e-to-user.html
==============

Following job illustrates how to send message to user in AX 3.0

X++:
static void JobSendMessage(Args _args)
{
    AOSSessionInfo  testSession;

    int             counter;
    int             maxSessions;

    container       users;
    int             sesId;
    userId          userId;
    ClientType      clientKind;
    date            logindate;
    int             logintime;
    str             clientComputerName;
    str             databaseSpid;
    str             itemSTr;
    userName        userName;
    AOSClientMode   clientMode;
    int             sessionCount;
    int             idleTicks;
    str             recipient = curuserid();// place here addressee userid
    int             recSesId = -1;
    ;

    [ users, maxSessions ] = SysUsersOnline::getAllOnlineUserInfo();
    for(counter = 1; counter <= maxSessions; counter++)
    {
        [   sesId,
            userId,
            clientKind,
            loginDate,
            loginTime,
            clientComputerName,
            databaseSpid,
            userName,
            clientMode,
            idleTicks
            ] = conPeek(users, counter);

            if(userId == recipient)
            {
                recSesId = sesId;
                break;
            }
    }

    if(recsesId != -1)
    {
        testSession = new AOSSessionInfo(recsesId);
        if (testSession)
        {
            AOSSessionInfo::sendMessage(
               recsesId, strfmt("@SYS55325", curuserid(), time2str(timenow(),0,0)),

                "Hello!");

            box::info("Delievered");
        }
    }
    else
    {
        throw error(strFmt("User %1 is offline.", recipient));
    }
}
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Ruslan Goncharov: A few words about sorting codes Blog bot DAX Blogs 0 18.02.2009 21:05
Ruslan Goncharov: From Microsoft Dynamics AX Programming newsgroup tricks Blog bot DAX Blogs 0 24.05.2008 00:08
Ruslan Goncharov: Quick sorting in info messages Blog bot DAX Blogs 0 09.02.2008 19:11
Inside Dynamics AX 4.0: The Security Framework Blog bot DAX Blogs 0 31.10.2007 11:40
axaptafreak: Send message to online user in Dynamics AX 4.0 (quick & dirty) Blog bot DAX Blogs 0 12.04.2007 16:10

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

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

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