Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Unable to import bank statement in BAI2 format

(0) ShareShare
ReportReport
Posted on by 11,633

Hi All,

I am trying to import bank statement in BAI2 format, but facing some issues. Initially, I was getting error that "Bank account is not identified...." . The reason is, in the BAI2 file received from Bank, the BSB number and the account number both are included as a single string whereas D365 expecting just the account number. So, if I remove the BSB number, the file imported successfully. Considering this, I have changed the XSLT file (BAI2CSV-to-BAI2XML.xslt) to consider only the bank account number by using the subString function in order to avoid manual intervention in the file. Now, when I try to import the file, I am not getting error related to Bank account, but getting a message that says "No bank account statements were imported".

When I checked the execution log under Data management, it doesn't show any error message. So I am clueless what is the cause of this and why the bank statements are not getting imported.

Does anyone have any clue or can point out what I might be missing?

Thanks,

Baber.

  • syed baber Profile Picture
    11,633 on at
    RE: Unable to import bank statement in BAI2 format

    I have raised this with Microsoft and they provided one of the solution, which includes editing the BAI2XML-to-Reconciliation.xslt file to extract the account number from the field which includes BSB number as shown below:

    pastedimage1596146244011v1.png

    Thanks,

    Baber.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Unable to import bank statement in BAI2 format

    HI,

    BankAccountTable. I have written a sample code above, which will truncate the BSB number from the import file and successfully imports the BAI2 file.

  • syed baber Profile Picture
    11,633 on at
    RE: Unable to import bank statement in BAI2 format

    Hi Manish,

    Thanks for your response. In which class/table, I can find this method ?

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Unable to import bank statement in BAI2 format

    Hi Baber,

    This has been a known issue for a few years now, unfortunately not all banks follows the Bank Account Identification. In some countries they have a format <BranchCode>-<BankAccountnumber> whereas some banks use only <BankAccountNumber>.  In countries like Australia, the same account number is re-used under different BSB numbers or branches.

    You can try the following solution, where you extend the SearchBankAccountTable method used by BAI2 import process. This solution is one workaround. Else you can try creating the BankACcountNumber including BSB like "012-2345887".

    protected BankAccountTable searchBankAccountTable(

           BankStatementNameText   _bankName,

           BankStmtISOAccountStatement _statement)

       {

           BankAccountTable                    searchedBankAccountTable;

           BankStatementIdentificationText     accountnumFromFile;

           int                                 accountnumSize;

           BankAccount                         bankAccountnum;

           searchedBankAccountTable = next searchBankAccountTable(_bankName,_statement);

           // Get the Account identifier from the import file bsb + accountnumber

           accountnumFromFile  = _statement.AccountIdOtherId;

           accountnumSize      = strLen(accountnumFromFile);

           // Get the bank account number without BSB number e.g 001-0023451

           bankAccountnum = subStr(accountnumFromFile,7,accountnumSize);

           if(bankAccountnum)

           {

               select crosscompany searchedBankAccountTable

                   where searchedBankAccountTable.AccountNum == bankAccountnum;

           }

           return searchedBankAccountTable;

       }

  • syed baber Profile Picture
    11,633 on at
    RE: Unable to import bank statement in BAI2 format

    Yes I did try to debug, by connecting DEV to UAT, but getting completely different error there and I cannot proceed to the actual error. The error is "Record with "some GUID" not found".  So now, I don't have any other options left to find out the root cause of this issue.

    Have you every imported BAI2 file format after modifying xslt ?

    Thanks,

    Baber.

  • Mea_ Profile Picture
    60,278 on at
    RE: Unable to import bank statement in BAI2 format

    Did you try to debug ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,459 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,066 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans