Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to join the Generaljournalaccountentry table to the Custtrans table?

(1) ShareShare
ReportReport
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
    4,643 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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,430 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,043 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans