Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Link between VendTrans and LedgerJournalTrans table

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

  • 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

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,263 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,112 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans