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:
If you found value in what I share, I've set up a Buy Me a Coffee page as a way to show your support.
Buy Me a CoffeeNo comments. Be the first one to comment on this post.
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 "buy me a coffee" link.
Join us.