Exporting Text Format Positive Pay File in Dynamics 365 for Finance and Operations

By Laura Lake | May 29, 2018

Exporting text format positive pay file in dynamics 365 for finance and operations

In Dynamics 365 for Finance and Operations, the default format of the Positive Pay output is XML. Microsoft has provided steps for the setup of Positive Pay as well as a sample XSLT file used to transform the output.

However, it is possible to create your own XSLT file for text or CSV format. The following sample code creates a fixed length text file but could be modified easily for CSV format. Note the output method highlighted below. Here is a link to the string manipulation functions used in the sample.

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl xslthelper" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xslthelper="http://schemas.microsoft.com/BizTalk/2003/xslthelper">
  <xsl:output method="text" omit-xml-declaration="yes" indent="yes"/>
  <xsl:template match="/">
      <xsl:for-each select="Document/BankPositivePayExportEntity">
        <!--Cheque Detail begin-->
        <xsl:value-of select='string("C02800")'/> 
        <xsl:value-of select="substring(concat(ACCOUNTNUM/text(),'          '),1,10)"/>
        <xsl:choose>
          <xsl:when test='CHEQUESTATUS/text()=normalize-space("Void") or CHEQUESTATUS/text()=normalize-space("Rejected") or CHEQUESTATUS/text()=normalize-space("Cancelled")'>
            <xsl:value-of select='string(" VD ")'/>
          </xsl:when>
          <xsl:when test='CHEQUESTATUS/text()=normalize-space("Payment")'>
            <xsl:value-of select='string(" RA ")'/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select='string("    ")'/>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:variable name="cknumpadded" select="concat('0000000000',normalize-space(CHEQUENUM/text()))"/>
<xsl:value-of select="substring($cknumpadded, string-length($cknumpadded) - 10 + 1, 10)" />
<xsl:variable name="amtdec" select="substring-after(AMOUNTCUR/text(), '.')" />
<xsl:variable name="amtval" select="substring-before(AMOUNTCUR/text(), '.')" />
<xsl:variable name="amtpadding" select="concat('00000000', $amtval)" />
<xsl:variable name="amtpadded" select="substring($amtpadding, string-length($amtpadding) - 8 + 1, 8)" />
<xsl:value-of select="concat($amtpadded,'V',substring($amtdec,1,2))" />
<xsl:variable name="year" select="substring(TRANSDATE/text(),3,2)" />
<xsl:variable name="month" select="substring(TRANSDATE/text(),6,2)" />
<xsl:variable name="day" select="substring(TRANSDATE/text(),9,2)" />
<xsl:value-of select="concat($month,$day,$year)" />
        <xsl:value-of select='string("                    ")'/>
<xsl:variable name="blk128" select='string("                                                                                                                               ")'/>
        <xsl:value-of select="substring(concat(BANKNEGINSTRECIPIENTNAME/text(),$blk128),1,128)"/>
        <xsl:text>&#13;&#10;</xsl:text>
      </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

It is important to note that when generating the Positive Pay file and the Open or Save prompt appears, you must change the file type to Txt. See the following screenshots.

1. Upload the transformation file as per the instructions in the link at the beginning of this article.

Exporting text format Positive Pay file

2. Generate Positive Pay

Positive Pay file in Dynamics 365 for Finance and Operations

3. Select Save As and save the file as Txt.

Exporting text format Positive Pay file

Exporting text format Positive Pay file in D365 for Finance and Operations

Special thanks to my teammate Karl Gunderson for lending his XSLT expertise to this project on how to export a text format positive pay file in Dynamics 365 for Finance and Operations.

 

Related Posts

Recommended Reading:

Managing Your Business Through Uncertain Times Using Dynamics 365 Finance and Operations

  Dynamics 365 Finance and Operations (F&O) can help you make informed decisions on how to move your business forward. […]

Read the Article
5.13.22 Power Platform

Using Power BI Object Level Security

  The following article will demonstrate how to use Power BI Object Level Security to disable column data based on […]

Read the Article
5.12.22 Dynamics CRM

How to Use the Stoneridge Support Portal

Stoneridge Software’s support portal is an intuitive and useful function that makes it easy for you to access resources to […]

Read the Article
5.6.22 Dynamics GP

Dynamics GP Transaction Removal: Purchase Orders

  Are you having performance issues with Purchase Orders?  Do you find that there are old Purchase Orders on your […]

Read the Article
5.5.22 Dynamics GP

The Real Story about the Long-Term Future of Dynamics GP Support

I’ve seen a number of people put forward comment that Dynamics GP is going away and you have to get […]

Read the Article

New Features in Dynamics 365 Business Central 2022 Wave 1 Release – Financial Enhancements

The Dynamics 365 Businses Central 2022 Wave 1 Release has a lot of new and exciting features to help your […]

Read the Article
4.29.22 Dynamics GP

Dynamics GP Transaction Removals: Bank Reconciliation

  This is part 2 of a 3 part series on Dynamics GP Transaction Removals. These quick tips will hopefully […]

Read the Article
4.28.22 Dynamics GP

Uncommonly Used Features – Integrate Purchasing and Payables to Fixed Assets in Dynamics GP

Being able to integrate Purchasing and Payables to Fixed Assets in Dynamics GP will help you create visibility for your […]

Read the Article

New Features in the Dynamics 365 Business Central 2022 Wave 1 Release – Ease-of-Use Features

  There are many new features in the Dynamics 365 Business Central 2022 Wave 1 Release to get excited about! […]

Read the Article

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X