Populate Boilerplate Document With Dynamics AX Data Using Word Templates

The document management function that allows you to create attachments that are based off a Word template.  What makes this a super useful feature is that you can populate the document on the fly with data from the record that you are creating the attachment for.

Everyone has templates that they have squirreled away on their computer that they continually use for boilerplate responses.  This takes it to the next level by creating all of these document for you based of the boilerplate documents… and they are not hidden on one persons computer any more.

How To Do It…

Start off by creating your template document.

To add a placeholder for the data within Dynamics AX, move the cursor to the location that you want to data to go, and then click on the Links menu button within the Comments group of the Insert ribbon bar, and select the Bookmark menu item.

20140207.01

When the Bookmark maintenance dialog is displayed, enter in the name for the placeholder and then click the Add button.

When you are finished, just close the form.

20140207.02

After you have finished adding in all of the bookmarks, save the file as a .dot file type.

20140207.03

Now click on the Document Types menu item within the Document Management folder of the Setup group within the Organization Administration area page.

Click on the New button within the menu bar to create a new record, give your document type a Type and Name, and then change the Class to Create a Microsoft Word document by using a Template.

20140207.04

This will enable the Options button within the menu bar that you should now click on.

When the Setup maintenance form is displayed, add a new record (CTRL+N) and select the main table that you want to associate the data from (in this case the CustTable table) and then point the Template file to your Word Template.

20140207.05

Change to the Fields tab, and add a new record for each of your bookmarks that you added to the template document.  Select the Data field that you want to embed in the template and type in the Bookmark that you want to put the field value into.

When you have finished with all of the bookmarks, then just click on the OK field to exit the form.

20140207.06

How It Works…

Now when you attach document to the document types where the master table matches the linked table in the new document type that you created

20140207.07

This will automatically create your personalized version of the document for you.

20140207.08

How cool is that.

Advertisements
4 comments
  1. Hi Murray,

    Please can I ask if you have ever managed to display a product image within the template?

    Regards

    Jonathan

  2. Jonathan, unfortunately not yet, I wonder how you could go about that though… something definitely that I will look into. Murray.

  3. steffi bansal said:

    Hi…has anyone been able to figure out how to display images through this feature in templates?

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: