Monday, August 28, 2017

AIF Document Service Outbound Message trigger in X++

//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());
}

No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...