Book Image

Microsoft Dynamics AX 2012 R2 Services

Book Image

Microsoft Dynamics AX 2012 R2 Services

Overview of this book

Table of Contents (17 chapters)
Microsoft Dynamics AX 2012 R2 Services
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

The send service framework


You can use the send service framework when you want to send outbound messages to asynchronous adapters. The following job demonstrates how you can send documents that contain titles to an outbound port:

static void CVRAxdSendTitles(Args _args)
{
   AxdSend axdSend = new AxdSend();
   AifConstraintList aifConstraintList = new AifConstraintList();
   AifConstraint aifConstraint = new AifConstraint();

   aifConstraint.parmType(AifConstraintType::NoConstraint);
   aifConstraintList.addConstraint(aifConstraint);

   axdSend.sendMultipleDocuments(classNum(CVRTitleDocument), classNum(CVRTitleDocumentService), AifSendMode::Async, aifConstraintList);
}

When you run the job, the following dialog will appear:

In this dialog, you can select an outbound port in the Port name field. In order for this to work, you should create an outbound port and add the CVRTitleDocumentService.find operation to the service operations that are exposed by the port. The Find operation is the default...