Microsoft Dynamics AX provides a way to import worker’s Credit card transactions out-of-the-box, however it works only if your credit card statement is already in XML format.
Most credit card companies (American Express, VISA) send statements to their clients in CSV format, so in order to leverage Dynamics AX credit card import functionality developers have to create additional transformation library and plug it into import sequence.
In this article we provide example of such transformation library in C# and step-by-step instructions on how to setup and execute credit card inbound AIF port with Microsoft Dynamics AX 2012, setup Credit cards for employees in Human Resource module and execute the import.
1) Extract attached Visual Studio project and sample files
2) Setup Inbound port and Transformation library in AIF
3) Setup workers credit card in Human Resources module
4) Run Credit card transactions import job using sample file attached
Extract attached Visual Studio project and sample files
The following files are included in CreditCardCodeSample.zip file attached to this post.
• AmexCsvTrasformLibrary.zip – Visual Studio C# project containing sample transformation library for 3 different file formats
• Amextest.csv – sample credit card statement
• Amextest.xml – sample XML output of transformation
Please note that these files are samples only and are provided “as-is.” You bear the risk of using them. You will need to modify them to match your credit card company's statement format.
Setup inbound port and Transformation library in AIF
1. Create new "AMEX" Inbound port
3. Select "Transform all requests" checkbox
7. Click "Load" button, and provide path to transformation DLL generated from the sample project (AmexCsvTransformLibrary.dll)
9. On Inbound Transforms form, Click "New" button and select transformation created on the previous step
11. Activate Inbound Port by clicking on "Activate" button
Setup workers credit card in Human Resources module
1. Open "Workers" form from Human Resources menu
Run Credit card transactions import job
1. Import credit card file by running "Travel and Expense\Periodic\Import a specific credit card file" job