Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Link between VendTrans and LedgerJournalTrans table

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

Can someone help me to find the relation between Link between VendTrans and LedgerJournalTrans table?

I am trying to find the invoice settlement made for a specific journal number in LedgerJournalTable.

Thanks in advance.

Regards,

Selva

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Link between VendTrans and LedgerJournalTrans table

    Thanks a lot Chaitanya

  • Verified answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Link between VendTrans and LedgerJournalTrans table

    Hi,

    Please try the following code. I am able to get data with it. If its returning null, take a transaction of type Payment in VendTrans and check once if any data is missing.

    static void AXC_VendTransVoucher(Args _args)
    {
        LedgerJournalTrans              ledgerJournalTrans;
        LedgerJournalTable              ledgerJournalTable;
        VendTrans                       vendTrans;
        VendTable                       vendtable;
        VendInvoiceJour                 vendInvoiceJour;
        
        while select vendTrans
            where vendTrans.TransType == LedgerTransType::Payment
            join vendtable
            where vendtable.AccountNum == vendTrans.AccountNum
            //&& vendtable.AccountNum == "V123" // Specify AccountNum here
            outer join ledgerJournalTrans
            where vendTrans.Voucher == ledgerJournalTrans.Voucher
            //&& ledgerJournalTrans.TransactionType == LedgerTransType::Vend
            join ledgerJournalTable
            where ledgerJournalTable.JournalNum == ledgerJournalTrans.JournalNum
        {
            info(strFmt("Account:%1, TransType: %2, JournalNum: %3, Type: %4", vendtable.AccountNum, vendTrans.TransType, ledgerJournalTable.JournalNum, ledgerJournalTable.JournalType));
        }
    }


  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Link between VendTrans and LedgerJournalTrans table

    Hi,

    It is vendor payment transaction

    Regards,

    Selva

  • Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Link between VendTrans and LedgerJournalTrans table

    Hi,

    Yeah is it vendor Invoice (or) vendor payment transaction.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Link between VendTrans and LedgerJournalTrans table

    Hi,

    Vendor transaction type

    Regards,

    Selva

  • Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Link between VendTrans and LedgerJournalTrans table

    Hi,

    Ok. What is the transaction type you are looking for specifically?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Link between VendTrans and LedgerJournalTrans table

    Hi Chaitanya ,

    Same issue still I am getting JournalNum as empty in vendtrans.

    In vendtrans table the JournalNum  field is empty for all records.

    kindly note that i am trying to do this before posting.

    Regards,

    Selva

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Link between VendTrans and LedgerJournalTrans table

    Hi,

    Please use following code which is based on voucher.

    static void AXC_VendTransVoucher(Args _args)
    {
        LedgerJournalTrans              ledgerJournalTrans;
        LedgerJournalTable              ledgerJournalTable;
        VendTrans                       vendTrans;
        VendTable                       vendtable;
    
        while select ledgerJournalTable
            join ledgerJournalTrans
            //where ledgerJournalTrans.TransactionType == LedgerTransType::Vend
            && ledgerJournalTable.JournalNum == ledgerJournalTrans.JournalNum
            join vendTrans
            where vendTrans.Voucher == ledgerJournalTrans.Voucher
           // && ledgerJournalTrans.JournalNum == "XYZ" // Specify JournalNum here
            join vendtable
            where vendtable.AccountNum == vendTrans.AccountNum
            //&& vendtable.AccountNum == "V123" // Specify AccountNum here
        {
            info(strFmt("Account:%1, JournalNum: %2", vendtable.AccountNum, ledgerJournalTable.JournalNum));
        }
    }


  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Link between VendTrans and LedgerJournalTrans table

    Hi Chaitanya ,

    I have tried that..no luck

    still I am getting JournalNum as empty in vendtrans.

    Regards,

    Selva

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Link between VendTrans and LedgerJournalTrans table

    Hi Sukrut,

    Relating VendInvoiceJour from the VendTrans is fine based on your explaination.

    but how to relate with LedgerJournaltable  ?? since vendtransid = 0 in LedgerJournalTrans

    Thanks,

    Selva

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans