Monday, 26 August 2013

Using SharePoint document templates in Daxeam



AX2012 introduced the ability of using document templates hosted in SharePoint within the AX document handling. This is a step by step guide on how to add a document type in document handling for use within Daxeam using a SharePoint template library and archive directory.

Configure document type

The first step is to configure a document type. On the document type, the class is set to ‘Template library’. this will enable the selection of a template record from the SharePoint document library. Optionally, it is also possible to configure the document type to save the created file back to SharePoint by setting the Archive directory to SharePoint and specifying the SharePoint URL.

Create document data sources

To get the document templates to appear in the document type, first you have to create your document data sources. This can be done from organization administration:

You are selecting from AOT queries. Don’t worry about the Module value. It is used for display only when selecting the data source in your word template. The example shows two Daxeam data sources created using the EAMAssetList and EAMWorkOrderLine ListPage queries. These will provide you with the main engineering asset and work order line fields.

 

Create word template document

With the document data source in place, a document template can now be created and one or multiple data sources can be selected for use within the template document. If the data sources are not there, check your options, you might not be connected to server. 
 
After the data source has been added, you should see your available fields. Drag and drop your fields into your document and optionally put additional formatting.

 

Saving the document template to a SharePoint library

With the document template created, you can now save this to the SharePoint library that was selected when setting up the document template. Back on the document type, when you now synchronize, the new template is added in and you can activate it (Note that your user must have access to SharePoint for this to work).

 

Using the document type

Back on the engineering asset details page, you can now add a new “Engineering asset details” document. It displays according to the title of the template reference of the document type. This allows you to have multiple templates using the same document type.

A new work doc is created and the data is populated. The document is automatically saved back to SharePoint based on the archive directory settings.