Import Credit Card Transactions for Expense Mgmt

This post is from the “too helpful not to share” file. I received this information recently on how to import credit card transactions for expense management in Dynamics AX 2009.

To set up importing of credit card transactions into expense management, go to Basic > Setup > Import > Documents. Following is a high level walkthrough of how to set it up:


1. Navigate to Basic > Setup > Import.

2. Select Global settings.

3. Enter a location for log files and close the form.

4. Select Documents. Note that the first time the form is opened, there may be a delay.

5. Click CTRL+N to add a new row.

6. In the Document Name field, enter a document name such as Credit Card Import.

7. In the Document class drop down, select the AxdTrvPBSMaindata class.

8. After selecting that class change settings as appropriate. If you click Validate, it ensures that the selected document class is valid and that the logging path is valid and the current user has access rights to it.

9. Close the form

10. Select Transformations.

11. Click CTRL+N to add a new row if a new row has not already been added.

12. In the Transformation Name field, enter a value.

13. In the Document Name field, select the document that you defined in steps 5 – 9 that corresponds to the transformation.

14. In the Type of transformation field, select Binary to transform non-XML files or XLST to transform XML files.

15. Load and validate any transformation you have created. (Note: If you have an XML file that already corresponds to the schema expected by Dynamics AX, then you do not need to load any transformations).

16. Close the Transformations form.

17. Select Formats.

18. In the Format Name field, enter a name.

19. Select the corresponding document name from the Document Name drop down.

20. Mark the Active field.

21. If you have created more than one transformation, they can be added and sequenced on the form that will open if you click the Transformation button.


Once you have completed the steps above, navigate to Expense Management > Periodic > Credit Cards > Credit Card Import. You will not be able to open this form until you have created a format using the steps above. Once a format has been created you simply point to the location of the file you want to import, select the corresponding format defined in the steps above, and import to your heart’s content.

The DLL(s) or XSLT(s) need to be created outside of Dynamics AX. If the credit card file being imported is a non-XML file, then code needs to be written and put in a DLL to transform the file into a format the AX accepts. If the credit card file being imported is an XML file, then an XSLT can be written to transform the file into one that Dynamics AX will accept. Obviously, somebody who is relatively technical will need to do this.

We have provided a sample DLL for transforming a credit card transaction file from AMEX. This can be found on PartnerSource: (this requires a valid PartnerSource login).


*** Update on Sept-16-2009 ***


I have received a number of requests for a sample XML file for the credit card import. I don’t have a sample XML file, but I can tell you how to generate the schema for the XML. The credit card import functionality uses the TrvTrvPBSMainDataService service to import credit card information. So the XML file needs to conform to the document schema expected by that service. To view the schema, navigate to Basic > Setup > Application Integration Framework > Services > TrvTrvPBSMaindataService > Service operations > Parameter schema > View schema. You’ll see a screen that shows you the schema and you can save it as an XSD by clicking Save as.


There’s also expense management training documentation posted on PartnerSource (requires valid PartnerSource login) that goes through the functionality of the application in pretty good detail.

*** Update on Sept-21-2009 ***

If your source data is not in the expected XML format, you can transform it by using an XSLT or a binary DLL. After you create your XSLT or DLL, you add it to the system and associate it with a document. Then you can select that transform to run when you import data (see process above).

There’s a binary transformation code sample on PartnerSource and CustomerSource (requires a valid login).