static void AifTestRun(Args _args) { // inbound messages new AIFGatewayReceiveService().run(); new AIFInboundProcessingService().run(); // outbound messages new AIFOutboundProcessingService().run(); new AIFGatewaySendService().run(); info("done"); }Example of "read" outbound:
static void AifTest(Args _args) { AxdSendContext axdSendContext = AxdSendContext::construct(); AifEntityKey aifEntityKey = AifEntityKey::construct(); Map keyData; AifConstraintList aifConstraintList = new AifConstraintList(); AifConstraint aifConstraint = new AifConstraint(); VendInvoiceInfoTable vendInvoice; XMLDocPurpose _xMLDocPurpose = XMLDocPurpose::Original; AifSendMode _aifSendMode = AifSendMode::Async ; select firstOnly vendInvoice order by RecId desc where vendInvoice.PurchId == 'BHF-000060'; keyData = SysDictTable::getKeyData(vendInvoice); aifEntityKey.parmTableId(vendInvoice.TableId); aifEntityKey.parmRecId(vendInvoice.RecId); aifEntityKey.parmKeyDataMap(keyData); axdSendContext.parmXMLDocPurpose(_xMLDocPurpose); axdSendContext.parmSecurity(false); aifConstraint.parmType(AifConstraintType::NoConstraint) ; aifConstraintList.addConstraint(aifConstraint) ; AifSendService::submitDefault( classnum(VendInvoiceService), aifEntityKey, aifConstraintList, _aifSendMode, axdSendContext.pack()); info("done"); }Example of "find" outbound. Export all records by query:
static void VKVend(Args _args) { VendTable vendTable; AxdSendContext axdSendContext = AxdSendContext::construct(); AifEntityKey aifEntityKey = AifEntityKey::construct(); AifConstraintList aifConstraintList = new AifConstraintList(); AifConstraint aifConstraint = new AifConstraint(); AifEndpointList endpointList; AifActionId actionId; Query query; QueryBuildDataSource qbds; query = new Query(queryStr(AxdVendTable)); AxdSend::removeChildDs(query); actionId = AifSendService::getDefaultSendAction(classnum(VendVendTableService), AifSendActionType::SendByQuery); aifConstraint.parmType(AifConstraintType::NoConstraint); aifConstraintList.addConstraint(aifConstraint) ; endpointList = AifSendService::getEligibleEndpoints(actionId, aifConstraintList); AifSendService::SubmitFromQuery(actionId,endpointList,query,AifSendMode::Async); }In case of changes and adding new services:
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.
Authors are allowed to set their own AdSense units.
Join us.