分类 默认分类 下的文章

static void CreateAlertUsingCode(Args _args)
{
EventInbox inbox;
;
inbox.initValue();
inbox.ShowPopup = NoYes::Yes;
inbox.Subject = "This is the Alert subject";
inbox.Message = "This is the 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(Address);
inbox.AlertFieldId = fieldnum(Address, Name);
inbox.TypeTrigger = EventTypeTrigger::FieldChanged;
inbox.CompanyId = curext();
inbox.InboxId = EventInbox::nextEventId();;
inbox.AlertCreatedDateTime = DateTimeUtil::getSystemDateTime();
inbox.insert();
}

https://www.theaxapta.com/2012/11/create-alert-using-x-codes.html

单位换算

sumQty  += UnitOfMeasureConverter::convert(
    WMSOrderTrans.qty, UnitOfMeasure::findBySymbol(UnitID).RecId,
    UnitOfMeasure::findBySymbol(PosisonRecordInformation.UnitID).RecId,
    true,
    InventTable::find(WMSOrderTrans.itemId).Product);