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)

RELATION BETWEEN LEDGERTRANS & PURCHTABLE and RELATION BETWEEN LEDGERTRANS & VENDTRANS

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

I have a field on the purchase order (purchtable) that I want to have in ledgertrans and vendtrans.

How I can to  ? There is relation ?

Thank for your help.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    305,561 Super User 2026 Season 1 on at

    Hi Ineslouou,

    There is no direct relation between a purchase order and the ledger trans.

    In fact it is possible to purge the purchase orders.

    If you need the link:

    Purchtable > PurchLine (PurchId) > VendInvoiceTrans (InventDimId) > VendInvoiceJour (InvoiceId, InvoiceDate, InternalInvoiceID) > LedgerTrans (LedgerVoucher, InvoiceDate).

    I have noted the table and field names by heart, so please verify if it is really correct.

  • raelhefn Profile Picture
    Microsoft Employee on at

    no direct relation between purchtable and the ledgertrans tables you can find relation through vouchers number through purchline table

  • Suggested answer
    Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    Finding relationship using Voucher number is really a bad idea. Never mind, what if someone has done setup so that whole journal(with multiple lines) having same voucher number????? it will be a trouble. I have been into this.

    Well here is my verdict

    LedgerJournalTrans.VendTransId == VendTrans.RecId

    //above relationship will take you to VendTrans (Table). Now use following method to reach PurchTable.

    PurchTable::find(VendInvoiceJour::findFromVendTrans(this.Invoice, this.TransDate, this.AccountNum).PurchId)

    //this represents VendTrans

    I have noticed some serious bugs from Microsoft using VoucherNumber, in AX 2012 RTM, R2, CU7 as well as in R3. If I get time, I would like to document those

  • Community Member Profile Picture
    on at

    Thank you for your help !

    Please could you just tell me how it's possible to link Purchtable to Vendtrans?

    Regards

  • Suggested answer
    Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    see below line of code is shouting itself

    VendTrans >> VendInvoiceJour >>PurchTable

    PurchTable::find(VendInvoiceJour::findFromVendTrans(this.Invoice, this.TransDate, this.AccountNum).PurchId)

  • André Arnaud de Calavon Profile Picture
    305,561 Super User 2026 Season 1 on at

    The LedgerJournalTrans option provided by Sohaib will only work if all invoices will be posted using a journal. If the invoices are posted directly from the purchase order, this link is not available.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hellow

    Could you please let me know relation between vendtrans table and ledgertrans table 

    Because we have deleloped new report for ledger and subledger transactions

    Report is working fine but when journal transactios posted to vendr account with duplicate voucher, other vendr transactions also including one vendor account

    Example

    Date               Vendor  Voucher    Ledger   Amt

    01/01/2017    AS001    FS0001     2000      1500

    01/01/2017    AS002    FS0001     2000      2500 

    Here, when i generate report for vendor AS001 system taking two lines and summing amt 4000/- and displaying in report

    actually here only 1st line amt only should be come on the report since i am generating report for vendor AS001

    Could you please check and let me knoe how can i restrict second line being diplaying on report

    Best Regards

    DAM

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

    Hi,

    Please try with the following relations. Check the postingtypes once as I pulled it from Ax2012.

    LedgerTrans.Voucher == VendTrans.Voucher and

    LedgerTrans.TransDate == VendTrans.TransDate

    VendTrans.AmountCur == Ledgertrans.AmountCur

    LedgerTrans.Posting == LedgerPostingType::VendSettlement or

                          LedgerPostingType::VendBalance or

                          LedgerPostingType::ExchRateGain or

                          LedgerPostingType::ExchRateLoss or

          LedgerPostingType::VendPurchLedger or

          LedgerPostingType::VendOffsetAccount or

          LedgerPostingType::VendInterest or

          LedgerPostingType::VendCashDisc or

          LedgerPostingType::VendPayment or

          LedgerPostingType::VendInvoiceDisc or

          LedgerPostingType::VendSettlement or      

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 21

#2
dserp Profile Picture

dserp 4

#2
dekion Profile Picture

dekion 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans