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)

SSRS Report: How Can I Get "MainAccount" Value From "LedgerJournalTransDaily" Form -> "Account" Field? (LedgerDimension)

(0) ShareShare
ReportReport
Posted on by 1,044

Hello awesome community~! I'm new to AX development and I'm still learning!

I'm developing an SSRS Report using DP class.

First please, here is the screen shot:

Help-new-4.PNG 

*Note: Form Path: General Ledger > Journals > General Ledger > Lines

In this form there is the field called "Account" which is broken in multiple values as shown in in the screen shot.

I want to get the "MainAccount" part of the this field.

When I right click the field and choose "Personalize" the system name of the field is: "LedgerJournalTrans.LedgerDimension"

How can I get the "MainAccount" part only?

Thanks in Advance!

*This post is locked for comments

I have the same question (0)
  • Momochi Profile Picture
    1,044 on at

    Hello Mr. Crispin!

    My baaaad! I forgot to type I am developing an SSRS report.......haha

    I want to get the value of mainaccount in DP class.

    Sorry for the mistake.

  • Verified answer
    Community Member Profile Picture
    on at

    LedgerJournalTrans.LedgerDimension -> DimensionAttributeValueCombation.Recid

    DimensionAttributeValueCombation.MainAccount -> MainAccount.Recid

    It quite clearly explained under the relation node of each table.

  • Momochi Profile Picture
    1,044 on at

    Thanks Mr. Martijn for your help and time. 

    But sorry I'm quite a newbie to AX development, here is my query:

    Help-New-5.PNG 

    if I wanted to get the main account using the relations you mentioned, what are the changes that needs to be done to my query?

  • Verified answer
    Momochi Profile Picture
    1,044 on at

    Just done with my search and this is what I found, worked and simple:

    mainAccountNum= MainAccount::find(DimensionAttributeValueCombination::find(_ledgerJournalTrans.LedgerDimension).MainAccount).MainAccountId;
    
    }

    from this source: 

    https://hellodax.com/2014/11/25/get-mainaccount-from-ledgerjournaltrans/

    Thank you guys for your time and help!

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans