Document template libraries for Dynamics AX 2012

Introduction

The Dynamics AX document handler has always been able to generate Word (or Excel) documents using Dynamics AX data (and that functionality still exists) but this functionality was extended and made easier to use in Dynamics AX 2012.

Template library

‘Template libraries’ are a new document type introduced in Dynamics AX 2012.

Go to Organisation administration > Setup > Document management > Document types and define a new document type (if required):

A Template library is a shared folder on a SharePoint site. You define the folder to be used in the Document templates fast tab which becomes visible when you select the Class ‘Template library’.

The standard demo Hyper-V Enterprise portal site includes a Shared directory. I created a new Shared folder and set the SharePoint site address and selected my folder:

Create a template

Open Word, and log into Dynamics AX using the office add-in:

Use the Add data button to add a document source:

The Fields action pane will show you all of the fields (and linked tables) from your data source.

Create your document template and add fields by dragging them into the template:

When you’re done, save the template as a normal word document (not a template) in your Template library folder:

Back in Dynamics AX, on the Document types form click ‘Synchronise’:

You can see that the system’s recognised the Primary table from the data source.

Now Activate the template:

Use the template

You’ll need to be on a form related to your ‘Primary table’ (Quotations in my case). This form has got a ‘Generate from template’ button and that shows the active templates linked to the form/table:

Click that option and the system opens word, creates a word document attachment linked to the selected record, and populates the fields on the template:

The document’s added as a Document handler attached document:

On the Document Handler, notice that the New button includes the template as an option (and this is how you add template documents when there’s no ‘Generate from temple’ option available on the main form):

Neat eh?

Advertisements

One thought on “Document template libraries for Dynamics AX 2012

  1. I would like to thank you for this article. The article is very clear and informative, and helped us to getting started with Word creation on our last project. The problem is that we soon found out that the Add-In for MS Word is very limited and is not powerful enough to create something more complex than a simple template document with a couple of text placeholders. We haven’t found a way to insert dynamic pictures, no way to insert dynamic content in headers and footers, impossible to display hierarchical data,…

    Since we need to create a lot of Word documents, we searched around a bit and found this Add-On for Dynamics AX: http://ax.docentric.com/. I have to say that this tool is very impressive and the built-in Add-In for Word simply cannot compare with it. It actually is a complete reporting tool for AX (even charts are supported), except that the design is made in Word. All those limitations from before are now gone. It has also made SSRS reporting obsolete and now we use this Add-On for both, SSRS reports and Word documents. For all those who are experiencing similar issues with the Dynamics AX Add-In for Word, I strongly recommend to take look at it.

    Like

Comments are closed.