Thursday 2 August 2018

Get voucher transactions details(Original document) in AX X++

When we want to show the original document of a transaction we make the following:
For this example we are going to create an Invoice Journal, Find the Invoice in:
Accounts Payable >> Inquiries >> Journal >> Invoice Journal
imagen1

Find our Invoice and click in Voucher
imagen2

Click in transaction Origins
imagen3

And here, we are going to see the Voucher original document
imagen4

There is another way to do this by code, this way is the following:
We are going to use the same Invoice that we used before.
For this example we are going to create a Job.
imagen5
  • Declare the following variables:
LedgerTransModule: is the class that load the data.
tmpLedgerBase: is the table that contain the original document information.
generalJournalEntry: is the table that contain the Voucher data.
imagen6

Initialize our LedgerTransModule variable
imagen7

Execute the process
imagen8

Return the information to the table temp
imagen9

We loop through  the table temp and specify the Module that can be:
  • Ledger
  • Bank
  • Cust
  • Vend
  • Sales, etc.
And we can use the fields that we need of the table temp, in this case we need the following:
  • Module
  • Voucher
  • Id
  • IdName
imagen10

Ready, the result set is the following:
imagen11

3 comments:

  1. Hi,
    The images are not supporting 8n this post. I have tried in chrome /IE/ Microsoft Edge... But doesn't load the image.
    Could you please load the images and help us.

    ReplyDelete
    Replies
    1. I have the same issue could you please share the post again

      Delete
  2. Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign. 정보이용료 현금화

    ReplyDelete

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...