Dynamics AX offers native integration with other Microsoft products. This is a powerful tool that makes a difference between Dynamics AX and any other software on the market. Exploiting these benefits will help us to integrate and satisfy better the companies where Dynamics AX is implemented.
Many times it has happened that we have documents or formats in which much of the information is constant, but it varies in some specific fields; or different formats for the same information, for example, contracts. In the following blog we will focus on integration between Microsoft Word and SharePoint to develop formats at the end user level through the combination of Correspondence and Library documents in SharePoint.
To produce documents with information from Dynamics AX into Word it is necessary to make the following settings on Dynamics AX:
- Configure Document Data Sources: You need to configure the query (Query) to be used to generate the information on Word. In this example, we will use a sales budget query.
USMF / Organization Management / Configure / Document Management / Document Data Origin
On the field Data Source Type, select the option “Query Reference”. On the field Data Source Name, select the technical name of the query that contains the information to be used, in this case “AXdSalesQuotation”. The enabled field defines whether or not this record will be displayed on Word. In our case it must always be Active.
Note: Dynamics AX has default queries. If you do not have a query with all the necessary information, you must create the query previously.
- Create Format in Microsoft Word: On Microsoft Word go to the Dynamics AX tab and connect to the environment that contains the information. Subsequently use the button “Add Data” and select the query previously configured.
- Add fields to the purchase order format: When adding fields to this format there are 3 options:
- Insert as value: Allows to include the specific value of a field; this is very useful for single records such as header data.
- Insert as column: Allows to enter values from different records, it is very useful for line data since the number of records may vary. This option is only available to insert into a table.
- Insert as tag: Only copies the field name.
Note: The first field (upper left corner) must be the key field. In this case, the sales budget code.
- Generate a combination from Word: To generate the combination from Word, we must first select that record with the data to carry out the correspondence merge. To do this, select the Filter button and choose the field and the record to be generated.
- Generate a Combination of Correspondence: Before doing the combination, it is necessary to save; then select the Combination button (Merge), which will generate a new document.
Note: It is possible to save this document and attach it to the record via standard attachments functionality.
- Correspondence merge from Dynamics AX: You can generate the combination directly from the register in Dynamics AX. Follow the next steps:
- Upload the template to a library on the Enterprise Portal (or in its absence a SharePoint library).
- Configure document types: You must set up a document type on Dynamics AX refering to a template library:
USMF / Organization Management / Configure / Document Management / Document Type
You need to specify the class as “template library” and its location on SharePoint.
Then, it is necessary to copy the Enterprise Portal http address up to the name of the library, which in this case is AXDocuments and paste this address into the SharePoint Site field on the configured document type.
Subsequently, on the document library field, select the library in which the Word template was saved, in this case AXDocuments.
Finally, select the button Synchronize. The list of templates loaded on the library will appear; then select the button Activate:
- Select the record you want to use to generate your document: When configured the document type, it will be available to be chosen as attached data on the records related to the query, in this case the sales budgets form.
This will automatically generate the correspondence merge with the record data to which the document is being attached, allowing you to consult it in the future.