Use Word Templates to Generate Standard Customer Correspondence

Tip Of The Day - Use Word Templates to Generate CorrespondenceYou probably have already used the Dynamics AX add-in within Excel to access data, but don’t forget that you can also do something similar within Word as well in order to create templates that will merge in data directly from Dynamics AX with the push of a button.  But it doesn’t stop there, you can then save the Word templates back to a template library and Dynamics AX will make it available to everyone through the client itself.

This is a great way to create lightweight reports or commonly used templates for correspondence that you have instant access to.

Getting Ready…

Before you start, you need to make sure that you have a query that Word is able to use as a data source.  Also, this query needs to be linked in some way to the master tables that are used in the main data forms, i.e. the CustTable.

If you have not already got queries defined, then you can do this by clicking on the Document Data Sources in the Document Management folder of the Setup group of the Organization Administration area page.

When the Document Data Sources maintenance form is displayed, click on the New button in the menu bar, and add a new record that has a Document Source Type of Query Reference and a Data Source Name of CustTable

When you have done this, just click on the Close button to exit the form.

20140113.01

How To Do It…

To create a template in Word, all you need to do is select the Dynamics AX ribbon bar and click on the Add Data button within the Design group.

20140113.02

When the Add Data dialog box is displayed, you can select the CustTable data source and then click the OK button.

20140113.03

This will open up a field explorer on the left which you can then just drag and drop any field from into the Word document in order to create field placeholders.

Additionally, if you create a table within the word document then you can create a repeating element.

Once you have created the template you can save it and then click on the Merge button within the Data group of the Dynamics AX ribbon bar.

20140113.04

This will create a new document that is populated with the data from Dynamics AX.

20140113.05

The next step is to make this template available to the users within Dynamics AX itself.  To do this, create a Document Library within SharePoint and save your new template there.

20140113.06

Once we have the document library, we just need to synchronize it with Dynamics AX by opening up the Document Types menu item within the Document Management folder of the Setup group of the Organization Administration area page.

If you don’t already have one, create a new Document Type with a Class of Template Library.  This will allow you to point to the SharePoint Site where you put your Word document, and then click the Synchronize button within the Document Templates tab.

This process should discover your document and then you can make it available by clicking on the If you don’t already have one, create a new Document Type with a Class of Template Library.  This will allow you to point to the SharePoint Site where you put your Word document, and then click the Active checkbox.

20140113.07

How It Works…

This will allow you to open up the master data form that is connected to your Word template (in this case the Customer maintenance form) and if you click on the Generate From Template button within the Attachments group of the Customer ribbon bar, you will see your document template is available to be selected.

20140113.08

Clicking on it will create a new Word document for you using the merge template that you created.

20140113.09

Also, it saves the document away as an attachment so that you can always reference back to it.

20140113.10

How cool is that.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: