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)

GeneralJournalAccountEntry to Purchtable

(0) ShareShare
ReportReport
Posted on by

 

Please can anyone tell me how I can link the General Ledger Actual table (GENERALJOURNALACCOUNTENTRY) to either the Purchase Order (PURCHTABLE), Purchase Order Line (PURCHLINE) or another table so I can get the Purchase Order Number.  I need to be able to get the purchase order number for GL records that have not been invoiced.
Many thanks

*This post is locked for comments

I have the same question (1)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Have a look at the following post on matching ledger postings with purchases:

    community.dynamics.com/.../148688

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

    Hi,

    You can either refer the post suggested by Vilmos (or) can use the following job to get the link.
    This job helps to find the link for the invoice and product receipt transactions.

    static void PurchTransactions(Args _args)
    {
    GeneralJournalAccountEntry journalAccountEntry;
    GeneralJournalEntry generalJournalEntry;
    PurchTable purchTable;
    PurchLine purchLine;
    VendTrans vendTrans;
    VendInvoiceJour vendInvoiceJour;
    VendPackingSlipJour vendPackingSlipJour;
    VendPackingSlipVersion vendPackingSlipVersion;
    SubledgerVoucherGeneralJournalEntry subledgerVoucherGeneralJournalEntry;

    // Purchase order invoice transactions
    while select journalAccountEntry
    join generalJournalEntry
    where journalAccountEntry.GeneralJournalEntry == generalJournalEntry.RecId
    join subledgerVoucherGeneralJournalEntry
    where subledgerVoucherGeneralJournalEntry.GeneralJournalEntry == generalJournalEntry.RecId
    join vendTrans
    where vendTrans.Voucher == subledgerVoucherGeneralJournalEntry.Voucher
    && vendTrans.transDate == subledgerVoucherGeneralJournalEntry.AccountingDate
    && vendTrans.Voucher == "xyz"
    join vendInvoiceJour
    where vendInvoiceJour.LedgerVoucher == vendTrans.Voucher
    && vendInvoiceJour.InvoiceAccount == vendTrans.AccountNum
    && vendInvoiceJour.InvoiceDate == vendTrans.TransDate
    join purchTable
    where purchTable.PurchId == vendInvoiceJour.PurchId
    // join purchLine
    // where purchLine.PurchId == purchTable.PurchId
    {
    info(strFmt("PurchId: %1", purchTable.PurchId));
    }

    // Purchase order product receipt transactions
    while select journalAccountEntry
    join generalJournalEntry
    where journalAccountEntry.GeneralJournalEntry == generalJournalEntry.RecId
    join subledgerVoucherGeneralJournalEntry
    where subledgerVoucherGeneralJournalEntry.GeneralJournalEntry == generalJournalEntry.RecId
    join vendPackingSlipVersion
    where (vendPackingSlipVersion.LedgerVoucher == subledgerVoucherGeneralJournalEntry.Voucher
    || vendPackingSlipVersion.CostLedgerVoucher == subledgerVoucherGeneralJournalEntry.Voucher)
    && vendPackingSlipVersion.AccountingDate == subledgerVoucherGeneralJournalEntry.AccountingDate
    //&& subledgerVoucherGeneralJournalEntry.Voucher == "xyz"
    join vendPackingSlipJour
    where vendPackingSlipJour.RecId == vendPackingSlipVersion.VendPackingSlipJour
    join purchTable
    where purchTable.PurchId == vendPackingSlipJour.PurchId
    // join purchLine
    // where purchLine.PurchId == purchTable.PurchId
    {
    info(strFmt("PurchId: %1", purchTable.PurchId));
    }
    }

    If you feel your question is resolved, please mark the answer as verified so that it helps others.

    Thanks,
    Chaitanya Golla

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
Liquid error: parsing "/globalsearch/?q=new+holland+methodist+church%2C+lincolnshire+%7C+lincolnshire+%7C++filetype%3Axls" - Nested quantifier +.