Miklix

Identifying Document Class and Query for AIF Service in Dynamics AX 2012

Published: March 16, 2021 at 6:20:57 PM UTC

This article explains how to use a simple X++ job to find the service class, entity class, document class and query for an Application Integration Framework (AIF) service in Dynamics AX 2012.


The information in this post is based on Dynamics AX 2012 R3. It may or may not be valid for other versions.

When asked to add a new field, change some logic or do some other modification to a document service running on an AIF integration port (inbound or outbound), I often end up spending way too much time searching for the actual classes behind the service.

Sure, most of the elements from the standard application are named fairly consistently, but way too often, custom code is not. The forms for setting up document services in AIF does not provide an easy way to see what code actually handles a service, but knowing the name of the service itself (which you can easily find in the port configuration), you can run this small job to save yourself some time - here it's running for the CustCustomerService, but you can change that to whichever service you need:

static void AIFServiceCheck(Args _args)
{
    AxdWizardParameters param;
    ;

    param   =   AifServiceClassGenerator::getServiceParameters(classStr(CustCustomerService));

    info(strFmt("Service class: %1", param.parmAifServiceClassName()));
    info(strFmt("Entity class: %1", param.parmAifEntityClassName()));
    info(strFmt("Document class: %1", param.parmName()));
    info(strFmt("Query: %1", param.parmQueryName()));
}
Share on BlueskyShare on FacebookShare on LinkedInShare on TumblrShare on XShare on LinkedInPin on Pinterest

Mikkel Bang Christensen

About the Author

Mikkel Bang Christensen
Mikkel is the creator and owner of miklix.com. He has over 20 years experience as a professional computer programmer/software developer and is currently employed full-time for a large European IT corporation. When not blogging, he spends his spare time on a vast array of interests, hobbies, and activities, which may to some extent be reflected in the variety of topics covered on this website.