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)
Suggested Answer

Joining LedgerJournalTrans to GeneralJournalEntry/GeneralJournalAccountEntry (1 to 1)

(0) ShareShare
ReportReport
Posted on by

Is there a way of joining the LedgerJournalTrans to the GeneralJournalEntry/GeneralJournalAccountEntry on a 1 to 1 level?  Joining through Voucher appears to be a 1 to many relation.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Amir Nazim Profile Picture
    5,994 on at

    GeneralJournalEntry tables links to SubledgerGeneralJournalEntry table by the "GeneralJournalEntry" field in SubledgerGeneralJournalEntry table.

    and yes it has 1 to many relationship based on voucher, dataareaid and trans date. this is valid.

    can you explain what is your exact requirement is ? and what you are looking to achieve ?

  • Mariano Gracia Profile Picture
    on at

    Take a look at this job, I hope it helps you to understant the relations between the tables:

    static void tutorialAccesLedgerJournalTransVoucher(Args _args)
    {
        Ledger                          ledger = ledger::findByLegalEntity(CompanyInfo::find().RecId);
        LedgerJournalTrans              ledgerJournalTrans;
        GeneralJournalEntry             generalJournalEntry;
        GeneralJournalAccountEntry      generalJournalAccountEntry;
        
        DimensionAttributeLevelValueAllView dimensionAttributeLevelValueAllView;
        DimensionAttribute                  dimensionAttribute;
        
        while select ledgerJournalTrans
            join generalJournalEntry
            index hint LedgerAccountingDateIdx
            where generalJournalEntry.Ledger    == ledger.RecId
               && generalJournalEntry.AccountingDate == ledgerJournalTrans.TransDate
               && generalJournalEntry.SubledgerVoucher  == ledgerJournalTrans.Voucher
            join generalJournalAccountEntry
                where generalJournalAccountEntry.GeneralJournalEntry    == generalJournalEntry.RecId
        {
            info(strFmt("%1", generalJournalAccountEntry.AccountingCurrencyAmount));
            
            //financial dimensions related to the voucher line
            
            while select dimensionAttributeLevelValueAllView
                where dimensionAttributeLevelValueAllView.ValueCombinationRecId == generalJournalAccountEntry.LedgerDimension
                join dimensionAttribute
                where dimensionAttribute.RecId  == dimensionAttributeLevelValueAllView.DimensionAttribute 
            {
                info(strFmt("%1 %2", dimensionAttribute.localizedName(), dimensionAttributeLevelValueAllView.DisplayValue));
            }
        }        
    }

  • Community Member Profile Picture
    on at

    I am trying to join the LedgerJournalTrans to the GeneralJournalAccountEntry on a 1 to 1 relationship for a display method.

    I am using LedgerJournalTrans "Txt" field as a way to use description.

  • karthi.turaga Profile Picture
    15 on at

    Hi,

    Please let me know if you have a solution.

    Thanks,

    karthik.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans