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 :
Microsoft Dynamics AX (Archived)

how to get transaction date and invoice no in vendtrans table

(0) ShareShare
ReportReport
Posted on by

hi,

i need to create payment voucher report.the report will generate after post the journal . i need to display the transaction date and invoice no from vendtrans table. so  i tried to join vendtrans and vendsettlement.but when i generate the report, no data from that field.

i wrote the code as below:

while select vendTrans
join VendSettlement
where vendSettlement.AccountNum == vendTrans.AccountNum
&& vendSettlement.TransCompany == vendTrans.dataAreaId
&& vendSettlement.TransRecId == vendTrans.RecId
join VendInvoiceJour
where VendInvoiceJour.InvoiceAccount == vendTable.AccountNum
&& VendInvoiceJour.LedgerVoucher == VendTrans.voucher
&& VendInvoiceJour.InvoiceDate == VendTrans.TransDate
join vendtransopen
where vendtransopen.AccountNum == vendTrans.AccountNum
&& vendtransopen.RefRecId == vendTrans.RecId

{
gTmpPaymDocu.Invoice = vendTrans.Invoice;
gTmpPaymDocu.VendTransTransDate = vendTrans.TransDate;

gTmpPaymDocu.insert();
}

---end of code

Thanks

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    thanks crispin.. another things is the report will generate after post the journal.

    so the data will be in vendsettlement right?

  • Verified answer
    Community Member Profile Picture
    on at

    I solved the problem as below. the report generate after posted the journal.

    if (gTblLedgerJournalTable.Posted)

           {

                   //add 5pm

               while select vendTrans              //where vendTrans.Voucher == ledgerJournalTrans_1.Voucher//ASAL   //where orgVendTrans.AccountNum == vendTable.AccountNum

               join vendSettlement

               where vendSettlement.AccountNum == vendTrans.AccountNum

                   && vendSettlement.TransCompany == vendTrans.dataAreaId

                   && vendSettlement.TransRecId == vendTrans.RecId

               join VendInvoiceJour

               where VendInvoiceJour.InvoiceAccount == vendTrans.AccountNum

                   && VendInvoiceJour.LedgerVoucher == vendTrans.voucher

               //    && VendInvoiceJour.InvoiceDate == vendTrans.TransDate

               {

                   gTmpPaymDocu.Invoice                = vendTrans.Invoice;

                   gTmpPaymDocu.VendTransTransDate     = vendTrans.TransDate;

                   gTmpPaymDocu.AmountCur              = vendTrans.AmountCur;

                   //gTmpPaymDocu.insert();

               }

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans