AIF Document Service Wizard

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Tools > Application Integration Framework > Create document service

Tools > Wizards > AIF Document Service Wizard

Use this wizard to create a new document service class and associated data classes for use with Application Integration Framework (AIF). If the AIF services that are included with Microsoft Dynamics AX do not meet your business requirements, you can use this wizard to create your own AIF services. For more information, see Creating New Document Services.

This wizard creates all the services, classes, and any other objects that you need to enable data exchange, including the following:

  • A project – A default project in the Application Object Tree(AOT) that contains all of the classes and objects created by the wizard. This project is located in the Projects > Private folder.

  • A node for the service – An AOT node for the service that you can use to set the service properties. A child node of the Services node in the AOT.

  • Nodes for the service operations – An AOT node for each service operation that you can use to set the service operation properties and permissions. The service operation nodes are child nodes of the service node in the AOT.

  • The service class, the document class, and the data object classes – The actual classes that encapsulate the data exchange business logic. Found in the Classes node in the AOT.

  • Data object type macro – A macro that contains all of the data types for the data objects referenced by the service class. The generated macro follows the naming convention Axd + document name + DCT. This macro is located in the AOT under the Macros node. The generated macro name is also added to the primary macro DataContainerTypes.

  • AxBC (Ax <Table>) classes – Classes that provide an object API on top of the database tables referenced in the query. Found in the Classes node in the AOT.

  • A new job – A job that generates the schema for the service class. This schema defines all the valid fields and business rules for those fields. Found in the Jobs node in the AOT.

All the objects that the wizard will create are shown in a summary screen before you click Generate. Any errors or warnings are displayed in an Infolog window.

The following tables provide descriptions for the controls in this form.

Buttons

Button

Description

< Back

Click to go back to the previous wizard screen.

Next >

Click to see the next wizard screen. When you click this button, the wizard performs validation on all the fields and displays any validation errors in an Infolog window.

Cancel

Click to exit the wizard.

Generate

Click to generate the AIF service and associated classes.

Finish

Click to exit the wizard after you generate the service classes.

Fields

Field

Description

Query

Select the query on which the new service class is based.

Tip

Make sure that the Update property is set to Yes for all the data sources in the query. This is necessary if the service class implements update and delete actions. If you are creating an AIF service in which you want to update data, the query data sources must be updatable. If you are creating an AIF service that does not require data updates, the query data sources can be non-updatable.

Document name

Derived from the name of the query you select. If the query name has a prefix of Axd, the prefix is removed and the resulting string is used as the document name. The document name must be unique among all documents

Document label

Type a document label. This label is used anywhere the document is referenced in the user interface.

Service class name

Derived from the document name with the string "Service" appended to it. The service class name must be unique among all class and table names. The wizard will create a node for the service class in the AOT under the Services node.

The service class is a wrapper class for the data exchange functionality. For each action supported by the class, a method is created on the service class. Actions supported by the service classes are as follows: create, delete, find, findKeys, getKeys, getChangedKeys, read, and update.

Document object class name

Derived from the document name. The document class name must be unique among all class and table names.

The document class is the root data object.

Axd class name

Derived from the document name with the prefix Axd. The Axd class name must begin with Axd and must be unique among all class and table names.

Service operations

Select the service operations that are supported by the service:

  • create – Creates one or more records in the database.

  • read – Reads one or more records from the database. If a table in the service query contains date effective fields, readAsOf and readRange service operations will be added.

  • update – Updates one or more records in the database.

  • delete – Deletes one or more records in the database.

  • find – Returns one or more records in the database. If a table in the service query contains date effective fields, findAsOf and findRange service operations will be added.

  • findKeys – Returns the ID values for one or more records in the database. If a table in the service query contains date effective fields, findKeysAsOf and findKeysRange service operations will be added.

  • getKeys – Returns the ID values for documents based on a document filter.

  • getChangedKeys – Returns the ID values for one or more records based on a document filter and a date. For more information, see Configuring AIF for change tracking.

By default, only the read field is selected.

When you select a service operation, the wizard will create a corresponding method on the service class and a service operation node for the service under the Services node in the AOT.

Note

If you create a document service without a read operation, all the metadata properties for the document service will be set to null.

Generate AxBC classes

Select this check box to generate an AxBC class (also named an Ax <Table> class) for each table in the query. AxBC classes provide an object API on top of the database tables. These classes manage data, manage access to and from the tables, encapsulate the business logic that is available through the corresponding form, create default field values, and provide an object interface to the individual tables.

AxBC classes are not required. However, you must generate these classes if you want to implement more advanced functions like custom value mapping or calculated parm methods.

Note

If you generate AxBC classes, you must override or remove methods on the AxBC classes for the code to compile without errors.

Regenerate existing AxBC classes

Select this check box if you want to refresh all the AxBC classes. Selecting this check box regenerates all AxBC classes related to the tables in the query.

This is necessary if you have AxBC classes for a particular table and that table has changed. For example, if a new field has been added to the table, selecting this check box will regenerate the AxBC classes and the table changes will be reflected in the new AxBC classes.