web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to add new field 'Name(AR,AP)' to STD BankAccountStatement ?

(0) ShareShare
ReportReport
Posted on by

How to add new field 'Name(AR,AP)' to STD BankAccountStatement ?

apexone01_5F00_01.png

Module

Cash and Bank Management >> Report >> Transactions >> Bank statement

---------------------------------------------------------------------------------------

Standard 

SSRS Report : BankAccountStatement

Table : BankAccountStatementTmp, BankAccountTrans

Classes : BankAccountStatementContract, BankAccountStatementDP

Query : BankAccountStatement

--------------------------------------------------------------------------------

Method insert record to TempDB

apexone01_5F00_02.png

----------------------------------------------------------------------

Solution Me (New AX Develop) ps. Have not tried yet

1.add new field 'Name(EDT: DirPartyName)' to BankAccountStatementTmp

2.find relation 'BankAccountTrans' table to 'DirPartyTable' or (VendTable and CustTable), edit method insert record query join. (I can't find relation)

I'm not sure relation.(Help me please)

BankAccountTrans.Voucher == (VendTrans.Voucher>VendTrans.AccountNum == VendTable.AccountNum>VendTable.Party == DirPartyTable.RecId>DirPartyTable.Name || CustTrans.Voucher>CustTrans.AccountNum == CustTable.AccountNum>CustTable.Party == DirPartyTable.RecId>DirPartyTable.Name)

3.edit SSRS Report.

ps. Have not tried yet

-------------------------------------------------------------

Help guide other good solutions or find relation to find Name(AR,AP) from 'BankAccountTrans' table.

I'm not sure relation.(Help me please)

BankAccountTrans.Voucher == (VendTrans.Voucher>VendTrans.AccountNum == VendTable.AccountNum>VendTable.Party == DirPartyTable.RecId>DirPartyTable.Name || CustTrans.Voucher>CustTrans.AccountNum == CustTable.AccountNum>CustTable.Party == DirPartyTable.RecId>DirPartyTable.Name)

Thank you.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Yes, you have to create a new field (EDT: DirPartyName)' to BankAccountStatementTmp

    namely: accountname(also to design layout)

    Please use the following code(rather add joins) in

    \Classes\BankAccountStatementDP\createBankAccountStatementTmp to insert_recordset statement.

    /// <summary>
    /// Adds the records to the <c>BankAccountStatementTmp</c> table.
    /// </summary>
    private void createBankAccountStatementTmp()
    {
    BankAccountTable bankAccounttable;
    BankAccountTrans bankAccountTrans;
    VendTrans vendTrans;
    VendTable vendTable;
    DirPartyTable dirPartyTable;
    CustTrans custTrans;

    insert_recordset bankAccountStatementTmp
    (
    FromDate,
    ToDate,
    CurrentBalance,
    BankTransType,
    TransDate,
    Voucher,
    DepositNum,
    PaymReference,
    PaymentMode,
    AmountCur,
    AmountCorrect,
    AmountMST,
    AccountID,
    Name,
    CurrencyCode,
    AccountName // Newly added
    )
    select
    fromDate,
    toDate,
    currentBalance,
    BankTransType,
    TransDate,
    Voucher,
    DepositNum,
    PaymReference,
    PaymentMode,
    AmountCur,
    AmountCorrect,
    AmountMST
    from bankAccountTrans
    where bankAccountTrans.AccountId == bankAccount
    && bankAccountTrans.TransDate >= fromDate
    && bankAccountTrans.TransDate <= toDate
    join vendTrans                                     // Added code from here
    where bankAccountTrans.Voucher == vendTrans.Voucher
    && bankAccountTrans.TransDate == vendTrans.TransDate
    && bankAccountTrans.AmountMST == -(vendTrans.AmountMST)
    join vendTable
    where vendTable.AccountNum == vendTrans.AccountNum
    join name from dirPartyTable
    where dirPartyTable.RecId == vendTable.Party // Added code to here
    join
    AccountID,
    Name,
    CurrencyCode
    from bankAccounttable
    where bankAccounttable.AccountID == bankAccount;
    }

    Similary for customer transaction, I think you have to run insertrecordset statement twice or can use logical OR condition to fetch data from vendtrans and custtrans in one insertrecordset statement.  

     //  Customer transaction

       {

           select bankAccountTrans

               join custTrans

               where bankAccountTrans.Voucher == custTrans.Voucher

               && bankAccountTrans.TransDate == custTrans.TransDate

               && bankAccountTrans.AmountCur == custTrans.AmountCur

               join vendTable

               where vendTable.AccountNum == vendTrans.AccountNum

                   join dirPartyTable

                   where dirPartyTable.RecId == vendTable.Party;

       }

    If you feel your question is resolved, please mark the answer as verified.

    Thanks,

    Chaitanya Golla

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans