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)

Display Account Name in the CustLedgerTrans.Report

(0) ShareShare
ReportReport
Posted on by 120

Dear Sir 

I  Would Like to add Account Name  to the CustLedgerTrans.Report

 that is present in AX 2012 in the model   Accounts receivable  

under Reports  - > Transactions  Ã  Customer à History By Transactions

I have add  AccountName to the table CustLedgerTransTmp I Move AccountName from Extended Data Type to the CustLedgerTransTmp

I have added new relation to table CustLedgerTransTmp

Called MainAccount(user)

 CustLedgerTransTmp.MainAccountId == MainAccount.MainAccountId

And I have Modify those lines to  CustLedgerTransDP  Classes

In the Method ClassDeclaration  I have added those lines

 

 [

    SRSReportQueryAttribute(queryStr(CustLedgerTrans)),

    SRSReportParameterAttribute(classStr(CustLedgerTransContract))

]

public class CustLedgerTransDP extends SRSReportDataProviderBase

{

 

  CustLedgerTransTmp                  custLedgerTransTmp;

 

    /* Add by Jamil */

 

    MainAccount                         mainaccount;

    DimensionAttributeValueCombination  _dimensionAttributeValueCombination;

    /* End */

    boolean                             totals;

    boolean                             showOnlyMainAccount;

    BillingClassification               billingClassification;

 

}

 

And in the Method insertCustLedgerTransTmp  I have added those lines

 

private void insertCustLedgerTransTmp(CustName _custName,

                                        CustTrans _custTrans,

                                        LedgerPostingType _postingType,

                                        boolean _isCredit,

                                        AmountCur _transactionCurrencyAmount,

                                        AmountMst _accountingCurrencyAmount,

                                        MainAccountNum _mainAccountId,

                                        DimensionDisplayValue _fullyQualifiedAccount,

                                        TraceNum _traceNum)

{

 

    custLedgerTransTmp.clear();

 

    // Added  by Jamil

 

    select * FROM mainaccount

    WHERE mainaccount.MainAccountId == _dimensionAttributeValueCombination.DisplayValue;

    info('Name',mainaccount.Name);

    pause ;

    custLedgerTransTmp.AccountName = mainaccount.Name  ;

 

    /* End of modification */

 

After I have added the  field  custLedgerTransTmp.AccountName to the report CustLedgerTrans.Report it display blank not data have been display

Waiting for your valuable replay 

Best Regards

Jamil 

*This post is locked for comments

I have the same question (0)
  • Moeen Ahmed Sultan Profile Picture
    1,402 on at
    1. Right-click CustLedgerTransTmp Table
    2. Click on Open Table Browser.
    3. Check the AccountName field. Does it contain data?
  • Moeen Ahmed Sultan Profile Picture
    1,402 on at

    custLedgerTransTmp.AccountName = mainaccount.Name;

    custLedgerTransTmp.insert(); //Insert this line befor end of modification

  • On-Hand Inventory I want to Add to the Report ItemName Profile Picture
    120 on at

    Hi  Moeen Ahmed

    What do you mean to Insert this line before end of modification I have inserted in this method  InsertCustLedgerTransTmp as the following :

    private void insertCustLedgerTransTmp(CustName _custName,

                                           CustTrans _custTrans,

                                           LedgerPostingType _postingType,

                                           boolean _isCredit,

                                           AmountCur _transactionCurrencyAmount,

                                           AmountMst _accountingCurrencyAmount,

                                           MainAccountNum _mainAccountId,

                                           DimensionDisplayValue _fullyQualifiedAccount,

                                           TraceNum _traceNum)

    {

       custLedgerTransTmp.clear();

       // Add by Jamil

       select * FROM mainaccount

       WHERE mainaccount.MainAccountId == _dimensionAttributeValueCombination.DisplayValue;

       info('Name',mainaccount.Name);

       pause ;

       custLedgerTransTmp.AccountName = mainaccount.Name  ;

       //

       custLedgerTransTmp.CustName = _custName;

       custLedgerTransTmp.AccountNum = _custTrans.AccountNum;

       custLedgerTransTmp.TransDate = _custTrans.TransDate;

       custLedgerTransTmp.Voucher = _custTrans.Voucher;

       custLedgerTransTmp.InvoiceId = _custTrans.Invoice;

       custLedgerTransTmp.Txt = _custTrans.Txt;

       custLedgerTransTmp.Currency = _custTrans.CurrencyCode;

       custLedgerTransTmp.TraceNum = _traceNum;

       custLedgerTransTmp.MainAccountId = _mainAccountId;

       custLedgerTransTmp.LedgerAccount = _fullyQualifiedAccount;

       custLedgerTransTmp.Posting = enum2str(_postingType);

       if (_isCredit)

       {

           custLedgerTransTmp.CreditAmountCur = -_transactionCurrencyAmount;

           custLedgerTransTmp.CreditAmountMST = -_accountingCurrencyAmount;

       }

       else

       {

           custLedgerTransTmp.DebitAmountCur = _transactionCurrencyAmount;

           custLedgerTransTmp.DebitAmountMST = _accountingCurrencyAmount;

       }

       // <GBR>

       if(BrazilParameters::isEnabled())

       {

           custLedgerTransTmp.FiscalEstablishmentId = _custTrans.fiscalEstablishmentId_BR();

       }

       // </GBR>

       else if (billingClassification)

       {

           custLedgerTransTmp.BillingClassification = billingClassification;

       }

       custLedgerTransTmp.insert();    /*  it is added already  to the method */

    }

    Best  regard  

    Jamil

  • On-Hand Inventory I want to Add to the Report ItemName Profile Picture
    120 on at

    Hi Moeen

    CustLedgerTransTmp Table it is Empty when I go to AOT and Right-click CustLedgerTransTmp Table

    and how can I trace the out put of the method before exaction of the report. 

  • Moeen Ahmed Sultan Profile Picture
    1,402 on at

    In the above code, you haven't written custLedgerTransTmp.insert() that's why I asked.

  • Moeen Ahmed Sultan Profile Picture
    1,402 on at

    info('Name',mainaccount.Name);

    Is this working?

  • On-Hand Inventory I want to Add to the Report ItemName Profile Picture
    120 on at

    the above code already contain  custLedgerTransTmp.insert()  I have marked it as red

  • On-Hand Inventory I want to Add to the Report ItemName Profile Picture
    120 on at

    when I add this

    info('Name',mainaccount.Name);

    pause;

    in the method is executed the report direct is displaying without executing  this   info('Name',mainaccount.Name);

    pause;

    but when I run this  under new job  as the following it is displaying Name as empty

    static void Job10(Args _args)

    {

    //  custLedgerTransTmp.clear();

       // Add by Jamil

       MainAccount mainaccount;

       DimensionAttributeValueCombination  _dimensionAttributeValueCombination;

       select * FROM mainaccount

       WHERE mainaccount.MainAccountId == _dimensionAttributeValueCombination.DisplayValue;

       info('Name',mainaccount.Name);

       pause ;

    }

  • Suggested answer
    Moeen Ahmed Sultan Profile Picture
    1,402 on at

    info(strFmt("Name: %1", mainaccount.Name)); //write this

  • On-Hand Inventory I want to Add to the Report ItemName Profile Picture
    120 on at

    I can not understand why it is displaying blank data ,but when I run following script under Microsoft SQL Server Management studio  it is displaying data for the Account Name

    SELECT A.NAME FROM [dbo].[MAINACCOUNT] AS A ,[dbo].DIMENSIONATTRIBUTEVALUECOMBINATION] AS B

    WHERE A.MAINACCOUNTID = B.DISPLAYVALUE

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