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!

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
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans