Send message to online user in Dynamics AX (quick & dirty)
1. make sure the user options are configured correctly (that means: set "Time poll interval" to 1 minute, set "Show popup" to "For all event rules")
2. make a button in the online user form that will open a dialog where you could enter your text
3. send the message to all users selected in the online user form datasource
Remember also to replace the "curuserid()" with the user id you want the alert to be sent to.
This is merely meant as an idea on how you can achieve sending messages to a user.
static void sendAlert(Args _args)
{
EventInbox inbox;
EventInboxId inboxId;
inboxId = EventInbox::nextEventId();
inbox.initValue();
inbox.ShowPopup = NoYes::Yes;
inbox.Subject = "Message to online user";
inbox.Message = "Message you want to send to user";
inbox.SendEmail = false;
inbox.UserId = curUserID();
inbox.InboxId = inboxId;
inbox.AlertCreatedDate = systemdateget();
inbox.AlertCreateTime = timeNow();
inbox.insert();
}
No comments:
Post a Comment