//AIF Document Service Outbound Message trigger in X++
//Trigger outbound message through AIF document service
static void sendOutMsg(XMLDocPurpose _xMLDocPurpose,AifSendMode _aifSendMode = AifSendMode::Async)
{
AxdSendContext axdSendContext = AxdSendContext::construct();
AifEntityKey aifEntityKey = AifEntityKey::construct();
AifConstraintList aifConstraintList = new AifConstraintList();
AifConstraint aifConstraint = new AifConstraint();
VendTable vendTable;
Map keyData;
vendTable = VendTable::find("V05000");
keyData = SysDictTable::getKeyData(vendTable);
aifEntityKey.parmTableId(vendTable.TableId);
aifEntityKey.parmRecId(vendTable.RecId);
aifEntityKey.parmKeyDataMap(keyData);
axdSendContext.parmXMLDocPurpose(_xMLDocPurpose);
axdSendContext.parmSecurity(false);
aifConstraint.parmType(AifConstraintType::NoConstraint);
aifConstraintList.addConstraint(aifConstraint);
AifSendService::submitDefault(
classnum(VendVendTableService),
aifEntityKey,
aifConstraintList,
_aifSendMode,
axdSendContext.pack());
}
//Trigger outbound message through AIF document service
static void sendOutMsg(XMLDocPurpose _xMLDocPurpose,AifSendMode _aifSendMode = AifSendMode::Async)
{
AxdSendContext axdSendContext = AxdSendContext::construct();
AifEntityKey aifEntityKey = AifEntityKey::construct();
AifConstraintList aifConstraintList = new AifConstraintList();
AifConstraint aifConstraint = new AifConstraint();
VendTable vendTable;
Map keyData;
vendTable = VendTable::find("V05000");
keyData = SysDictTable::getKeyData(vendTable);
aifEntityKey.parmTableId(vendTable.TableId);
aifEntityKey.parmRecId(vendTable.RecId);
aifEntityKey.parmKeyDataMap(keyData);
axdSendContext.parmXMLDocPurpose(_xMLDocPurpose);
axdSendContext.parmSecurity(false);
aifConstraint.parmType(AifConstraintType::NoConstraint);
aifConstraintList.addConstraint(aifConstraint);
AifSendService::submitDefault(
classnum(VendVendTableService),
aifEntityKey,
aifConstraintList,
_aifSendMode,
axdSendContext.pack());
}
No comments:
Post a Comment