Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to join the Generaljournalaccountentry table to the Custtrans table?

Posted on by 5

Hello, I need to filter for vouchers beginning with CIV, WO, etc with the ledger account beginning with 113120. To my understanding this requires bringing the ledger account over to the custtrans table. I am a little confused as there is a generaljournalentry and other tables. What is the relationship needed to accomplish this? thanks 

  • Verified answer
    udaY-ch Profile Picture
    udaY-ch 4,624 on at
    RE: How to join the Generaljournalaccountentry table to the Custtrans table?

    Hi

    Use custtrans voucher to connect genenraljournalentry table through subledgervoucher

    And from generaljournalentry you will find a connection to generaljournalaccountentry by using recid

    Something like this,

    Public static void voucher(Args _args)
    {
        CustTrans                   custTrans;
        GeneralJournalEntry         generalJournalEntry;
        GeneralJournalAccountEntry  generalJournalAccountEntry;
        
        
        select custTrans
            where custTrans.Voucher == "Yourvoucher"
        join generalJournalEntry
            where generalJournalEntry.SubledgerVoucher == custTrans.Voucher
        join generalJournalAccountEntry
            where generalJournalAccountEntry.GeneralJournalEntry == generalJournalEntry.RecId
        {
            info(strFmt("generalJournalAccountEntry %1", generalJournalAccountEntry.TransactionCurrencyAmount));
        }
    }

    Uday

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans