web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Link between VendTrans and LedgerJournalTrans table

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Following are the tables(with relations) involved to relate  vendTrans and LedgerJournaltrans.

    vendTrans.Voucher == subLedgerGeneralJournalAccountEntry.subLedgerVoucher

    LedgerJournalTable:

    LedgerJournalTable.LedgerVoucher == subLedgerGeneralJournalAccountEntry.subLedgerVoucher

    LedgerJournalTrans:

    LedgerJournalTable.JournalNum == LedgerJournalTrans.JournalNum

  • Community Member Profile Picture
    on at

    Hi Sukrut,

    Thanks for your reply.

    i am getting VendTransId =0 i dont know why ??

    Regards,

    Selva

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

    Hi,

    Please use following code/job to get the link between vendTrans and LedgerJournalTrans.

    static void AXC_VendTrans(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.JournalNum == ledgerJournalTrans.JournalNum
           // && 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
    on at

    Hi Chaitanya ,

    I am getting JournalNum as empty in vendtrans.

    what should i do ??

    Thanks,

    Selva

  • Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Can you remove this range:

    ledgerJournalTrans.TransactionType == LedgerTransType::Vend

    and check once.

  • Community Member Profile Picture
    on at

    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

  • Community Member Profile Picture
    on at

    Hi Chaitanya ,

    I have tried that..no luck

    still I am getting JournalNum as empty in vendtrans.

    Regards,

    Selva

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

    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));
        }
    }


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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans