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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 10

#2
Harisgillani Profile Picture

Harisgillani 4

#2
dserp Profile Picture

dserp 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans