Setup Document management

This article describes how to setup document type in Dynamics AX 2012 and how to transfer data stored in Dynamics AX tables into documents of different types like Word, Excel… You can use document type if you have to export data from an invoice, journal or other form into a document with standard text. To illustrate the setup, I will create a word document, linked to the free text invoice.

1/ Prerequisites

User setup

Access: Files > Tools > Options > General tab

  • Go to the user option to allow the use of document handling: select “Document handling active”
  • Select “Show attachment status”  to highlight the “Attachment button when a document is attached to the record (invoice, journal, …)

DocumentType015

 

General setup

Access: Organization administration > Setup > Document management > Document managment parameters

  • In  tab General:  in the Archive directory field, enter the path to the archive directory.
  • In tab Number sequences: select the number sequence code to use for naming your documents

DocumentType016

2/ Create a new document type linked to a document template

Step 1: Create a word template

  • Create a word document with the format: “Microsoft word template”
  • In the place where you want variable datas, you need to insert a bookmark. The bookmarks will be linked to Dynamics AX. Example, I want to display the invoice number, or the invoice date, …

DocumentType005

Step 2: Create a new document type

Access: Organization administration > Setup > Document management > Document types

  • Create a new type and name it.
  • Choose the class. In this example, I choose : “Microsoft Word document”.
  • Set up the “Archive directory” (this is where the created documents are stored).
  • In the remove field, you can choose between two options : remove document only or remove document and physical file.

DocumentType001

 

  • Click on “Option”
  • On the Overview tab, in the column “Table”, select the table which the needed data primarily depend with the document template. In my example, I choose the table from the customer free text invoice.

DocumentType002

 

  • In the field “Template file”, select the word document template to use.

DocumentType003

 

  • Go to the “Field” tab
  • In this form, select all the data you want to display in the word document.
  • To create a new line : Ctrl + N
  • To delete a line : Alt + F9

DocumentType004

  • For each line, enter in the column “Bookmark” the same name that you put in the template (word document).

DocumentType012

  • You need to have exactly the same number of bookmarks in the word document and in the dynamics AX setup.
  • Remark : if you want to use a specific value several times, you have to create a new bookmark in Dynamics AX and in Word, because you can only use a Dynamics AX bookmark with one Word bookmark.

DocumentType013

 

 

3/ Use a document type

Access: File > Command > Document handling

  • Go to the the form which uses the primary table of the document type that you just created. In my example : All free text invoices form
  • Select a line
  • Click on the “Attachment” button or go to Files > Command > Document handling

DocumentType011

 

  • Click on “New” and select the document type.

DocumentType009

  • Dynamics AX creates a new document : one new line in the document handling form and a word document.
  • You can add description in the document handling form if needed.

DocumentType010

  • When you go to the word document, you can see the datas from the free text invoice.

DocumentType014

 

Remark : If you don’t know the name of the table. Go to the form (example free text invoice form). Select a record, make a right click and select “Personalize”. In this screen, you can find the name of the table. 

DocumentType017

 

 

Advertisements

One thought on “Setup Document management

  1. Pingback: Hello world! | ax-diary

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