Tuesday 28 June 2016

Create alert in AX.using X++

static void CreateAlert(Args _args)
{
    EventInbox          inbox;
    ;
 
    inbox.initValue();
    inbox.ShowPopup     = NoYes::Yes;
    inbox.Subject       = "Alert subject";
    inbox.Message       = "Alert message";
    inbox.AlertedFor    = "This alert is just information no links are available";
    inbox.SendEmail     = false;
    inbox.UserId        = curuserid();
    inbox.TypeId        = classnum(EventType);
    inbox.AlertTableId  = tablenum(CustTable);
    inbox.AlertFieldId  = fieldnum(CustTable, AccountNum);
    inbox.TypeTrigger   = EventTypeTrigger::FieldChanged;
    inbox.CompanyId     = curext();
    inbox.InboxId       = EventInbox::nextEventId();
    inbox.AlertCreatedDateTime = DateTimeUtil::getSystemDateTime();
    inbox.insert();
}

No comments:

Post a Comment