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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to add Purchid and invoiceid fields in Voucher Transactions form

(4) ShareShare
ReportReport
Posted on by 12
Hi,
 
I need to add Purchid and invoiceid fields in Voucher transactions form. I need to add it as a physical field instead of display methods. Kindly let me know for any possibilities.
 
 
 
Thanks,
Hamza
Categories:
I have the same question (0)
  • Diego Mancassola Profile Picture
    878 on at
    Hello, it's not so easy at all to do that.
     
    If your business requirement accept don't have a real time data, i suggest you that calculate these data after posting using a nightly batch using something like that:
     
    select firstonly vendInvoiceJour
    where vendInvoiceJour.ledgervoucher == GeneralJournalEntry.SubledgerVoucher && vendInvoiceJour.InvoiceDate  == GeneralJournalEntry.AccountingDate;
    if (vendInvoiceJour)
    {
        generalJournalEntry.InvoiceId = vendInvoiceJour.InvoiceId;
        generalJournalEntry.PurchId = vendInvoiceJour.PurchId;
        generalJournalEntry.update();
    }
  • Suggested answer
    Giorgio Bonacorsi Profile Picture
    3,199 on at
    Hello,
     
    About the invoice number, usually each voucher have one invoice number. Hence you can add the "document" field into the voucher for,:
     
    However, if you need to include even the PO a custom solution is required.
    The challenge is that one voucher can aggregate multiple POs, so you’ll need a custom query to break down the voucher structure and view the individual PO details.

    You can follow Diego’s guidance to start building your query.

    Thank you,
    Giorgio
  • Hamza Profile Picture
    12 on at
    Hi Giorgio,
     
    The Document field is empty, it is not displaying invoice numbers. And i dont want to create any new fields in Generaljournalentry table and populating those fields through batchjobs. Is there any other options to achieve this?

    Thanks,
    Hamza
  • Suggested answer
    Paolo Cecchelli Profile Picture
    671 on at
    Hi Hamza,
     
    you could use the Default Descriptions and choose the PurchID and the Invoice ID::
     
    You can set it up as something like this:
    so that in the description of the transaction (that is filterable) you will have something like this:
     
     
    Of course that will work only for newly-posted vouchers, for the already posted ones you will have to modify them manually using the "Edit internal voucher data" function.
     
    Two other points:
    - Of course being a description field, is not the best if you have to use it to do queries...
    - As Giorgio was mentioning, there is the problem that if you have more than 1 PO in the invoice, it will bring in the description only the first one
     
    Hope it helps
  • Hamza Profile Picture
    12 on at
    Will there be any other options like adding some views as datasources and adding fields from there to Grid.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 771

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 629 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 496

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans