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)

GeneralJournalEntry/GenerlJournalAccountEntry

(0) ShareShare
ReportReport
Posted on by 165

Hi All,

I'm trying to establish the relationship between GeneralJournalEntry/GenerlJournalAccountEntry and the Accounts Payable tables(VendTrans etc..). VendTrans relates to LedgerJournaltable, but there's no link between LedgerJournalTable and GeneralJournalEntry/GenerlJournalAccountEntry.

Any help will be highly appreciated.

thanks

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    I don't think if that's the case of no relationships.

    as I can see tags are related to BI, so I would like to know more about your business requirement. vendTrans can represent many things such as following

    1) vendor payments

    2) vendor invoices

    3) vendor settlements

    Would it be possible for you to give us few more details, please.

  • Michael Chukwunyere Profile Picture
    165 on at

    I'm writting a report that needs information from vendtrans table and GenerlJournalAccountEntry table. i'm looking for a way to join the tables directly or indirectly.

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    as I said there can be many ways to join these depending upon what you are trying to do. as you haven't given a specific description of your business requirement, so allow me to present a general answer. please have a look at next query to see how these tables are joined. let us know if you got any questions around this.

    LedgerRecId currentLedgerRecId;
    
    currentLedgerRecId = Ledger::current();
    
    SELECT FIRSTFAST * FROM GeneralJournalEntry ORDER BY GeneralJournalEntry.AccountingDate ASC, GeneralJournalEntry.JournalNumber ASC, GeneralJournalEntry.SubledgerVoucher ASC 
    WHERE ((GeneralJournalEntry.Ledger = currentLedgerRecId)) 
    
    JOIN * FROM GeneralJournalAccountEntry 
    WHERE GeneralJournalEntry.RecId = GeneralJournalAccountEntry.GeneralJournalEntry 
    
    JOIN * FROM DimensionAttributeValueCombination 
    WHERE GeneralJournalAccountEntry.LedgerDimension = DimensionAttributeValueCombination.RecId 
    
    JOIN * FROM MainAccount 
    WHERE DimensionAttributeValueCombination.MainAccount = MainAccount.RecId 
    
    OUTER JOIN * FROM FiscalCalendarPeriod 
    WHERE GeneralJournalEntry.FiscalCalendarPeriod = FiscalCalendarPeriod.RecId 
    
    EXISTS JOIN * FROM SubledgerVoucherGeneralJournalEntry 
    WHERE GeneralJournalEntry.RecId = SubledgerVoucherGeneralJournalEntry.GeneralJournalEntry 
    AND VendTrans.Voucher=SubledgerVoucherGeneralJournalEntry.Voucher 
    AND VendTrans.TransDate=SubledgerVoucherGeneralJournalEntry.AccountingDate
  • Sukrut Parab Profile Picture
    71,735 Moderator on at

    You can join through subledgerVoucherGeneralJournalentry

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Shoaib Cheema has provided you complete list of tables to extract data from GeneralJournalAccountEntry. For your convenience, I am providing the query which provides the relation between VendTrans and GeneralJournalAccountEntry.

    static void VendTransaction(Args _args)
    {
        GeneralJournalAccountEntry          journalAccountEntry;
        GeneralJournalEntry                 generalJournalEntry;
        VendTable                           vendTable;
        VendTrans                           vendTrans;
        DataAreaId                          companyId;
        
        companyId = curext();
        
        select journalAccountEntry
        join generalJournalEntry
            where ((generalJournalEntry.RecId == journalAccountEntry.GeneralJournalEntry)
                && (generalJournalEntry.SubledgerVoucherDataAreaId == companyId))
            join AccountNum, RecId from vendTrans
                where ((vendTrans.Voucher   == generalJournalEntry.SubledgerVoucher)
                    && (vendTrans.TransDate == generalJournalEntry.AccountingDate)
                    && (vendTrans.ReportingCurrencyAmount == journalAccountEntry.ReportingCurrencyAmount))
                join AccountNum, Party from vendTable
                    where (vendTable.AccountNum == vendTrans.AccountNum);
    }


     

  • Michael Chukwunyere Profile Picture
    165 on at

    thanks Sohaib... very helpful

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
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans