Electronic vendor payments in AX 2012

This post is a technical overview of how to process electronic vendor payments in Microsoft Dynamics AX 2012. It is primarily targeted at consultants and developers who have implemented, or are looking to implement, Dynamics AX 2012.

1. Overview

The creation of bank files to make vendor payments has changed dramatically in Microsoft Dynamics AX 2012. No longer does one need to create classes and write code; instead, all you have to do it create an XML transformation document (XSLT).
In previous versions of Dynamics AX, the developer had to modify classes in order to create a payment file. These classes were typically complex to understand, and this complexity led to a variety of different modification methods; managing these has its own challenges.
The core purpose of these classes was to create a text file and save that text file to a hard drive. Generally these text files were very simple CSV files. One of the limitations of this approach was the complexity involved in generating XML documents from these files; this has now been rectified. As banks start to request payment files in different formats, such as XML, Microsoft has extended the Dynamics AX Application Integration Framework (AIF) to allow the creation of vendor payment files in XML-based formats.
In this post we look at how to create these files.

2. The XML document

The new vendor payments XML document is based on the query ‘VendPayments.’

3. Setting up an outbound payment format (XML)

This is based on the Single Euro Payments Area (SEPA) Credit Transfer xslt example as supplied by Microsoft.
Create a directory “C:\AIF Examples\SEPA.”

3.1 Export the XSLT sample

In the “Resources” node in the AOT find and “Open” the object “VendPayments_SEPACreditTransfer_xslt”.
Export the XSLT sample
Click on “Export” and save the document in the new directory.
Export the XSLT sample
Export the XSLT sample

3.2 Set up an outbound port for electronic payment

Go to ‘System administration > Setup > Services and Application Integration Framework > Electronic payment services > Outbound ports for electronic payments.’
Click on “New.”
Enter a “Payment format” e.g. “SEPACreditTransfer.”
Specify the path where the XSLT file is stored.
Specify the “Outbound folder.”
Setup an outbound port for electronic payment
Click on “Create ports.”
Set up outbound port for electronic payment
Click on “Payment processing data.”
Enter the information specific for the payment format.

Set up outbound port for electronic payment

3.3 Create a payment journal

Accounts payable > Journals > Payments > Payment journal.
Open the lines and click on Functions > Generate payments.
Select “Export payment using service” and select the new “SEPACreditTransfer.”
Create payment journal
Click on OK.
Modify the “Payment processing data” of required and then click on “OK.”
Then, assuming that the AIF services are running in batch, the document will be processed and exported to the specified directory.

4. Setting up an outbound payment format (CSV)

The problem: AIF is designed to only export XML documents, and most of the banks we deal with only accept CSV files.
The solution: set up an outbound port for electronic payment.

4.1 Setup an outbound port for electronic payment

Create a new “Outbound ports for electronic payments” 
Setup an outbound port for electronic payment 
(Note: While it is mandatory to specify the XSLT path to create the electronic port, it is not used.)

4.2 Modify the outbound port

Open the outbound port.
Go to ‘System administration > Setup > Services and Application Integration Framework > Outbound ports.’
Select the port you just created and deactive it.
Modify the outbound port 
You will noticed that there is a non-standard field called “File extension.” This is an enum and by default is set to XML and therefore standard AX. If you select another value, in this instance “CSV,” then the file will be exported with an extension of CSV.
Select “CSV” for the field “File extension.”
In this process we won’t be using “Outbound piplines” so untick the checkbox. Instead we will use the “Outbound transforms” so select the “Transform all responses” checkbox and click on “Outbound transforms.”
Modify the outbound port
Click on “Manage transforms.”
Click on “New.”
Enter in the values for “Name” and “Description” leaving “Type” as XSL.
Next click on the “Load” button and select the appropriate XSLT file.
Modify the outbound port
Click on “Close.”
Click on “New” to create a new “Outbound transforms” and select the transform you created above.
Modify the outbound port
Click on “Close.” If the XSLT contains scripts you will get a warning message; if you trust the source select OK and continue.
Activate the outbound port.
Go back to your payment journal and generate payments again, however this time pick the new payment format.
Activate the outbound port.
Once again run the AIF services.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.