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)

Open Customer Invoices

(0) ShareShare
ReportReport
Posted on by 336

Hello, AXers :)

i'm asking here, about a quick SQL Query to get all Open Customer Invoices, and which table to use for Open Cust invoices ?

With these fields:

1. CreatedDateTime or the date of creation of the invoice

2.Invoice Id

3. DataAreaId

4. Invoice Date

5.Invoice Account

6.Invoice Address

7.Warehouse.

8.Status

Thanks in advance :)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hello adax, 

    You should be able to achieve this in the standard open customer invoices form through personalizations. 

    1425.inv.png

    Would be great if you could double check and test and let us know the outcome. 

    Many thanks, 

    Ludwig

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

    Hi Adax,

    I don't know the purpose of accessing data directly instead of using inquiries or reports. But if you do insist, you would need to query on CustInvoiceJour/Trans tables and CustTrans/CustTransOpen tables.

    Not sure what you mean with the status field. Is it about being an open transaction or not?

  • AdnDalhi Profile Picture
    336 on at

    Hi André,

    Thanks for your answer,

    I need to retrieve only the Cust Invoice headers, for the status field i believe i can ignore it, because the custTransOpen do not contain this field, and also this table contain only Open Transactions,

    The goal, is really just to pull all Cust Open Invoice, with their( CreatedDateTime : Date of creation of this invoice / Cust Account / DataAreaId / Invoice Address / Invoice Amount / Invoice date / Invoice Status (Paid or Open))

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi Adax, I don't know why you need to code something here but probably have a look at the open invoice form that I shared above and how it is generated. It might give you some ideas and insights into what you are looking for. Best regards, Ludwig

  • AdnDalhi Profile Picture
    336 on at

    Hello , @Mohammed El-Khatib

    Any help please, i will be grateful.

    Thanks

  • Verified answer
    AdnDalhi Profile Picture
    336 on at

    My ticket has been resolved, thanks to you all, i've used the following query, and i validated the data extraction,

    Thanks to you all, appreciate :)

    SELECT
    
    CUSTTRANS.CREATEDDATETIME AS [Created date time],
    
    CUSTTRANS.INVOICE AS [Invoice Id],
    
    CUSTTRANSOPEN.ACCOUNTNUM AS [Customer account],
    
    CUSTINVOICEJOUR.INVOICEACCOUNT AS [Invoice account],
    
    CUSTINVOICEJOUR.CUSTGROUP AS [Customer group],
    
    CUSTINVOICEJOUR.INVENTLOCATIONID AS [Warehouse],
    
    --LOGISTICSPOSTALADDRESS.ADDRESS AS [Invoice address],
    
    --LOGISTICSPOSTALADDRESS.STREET AS [Street],
    
    --LOGISTICSPOSTALADDRESS.ZIPCODE AS [Zipcode],
    
    --LOGISTICSPOSTALADDRESS.CITY AS [City],
    
    --LOGISTICSPOSTALADDRESS.COUNTY AS [County],
    
    --LOGISTICSPOSTALADDRESS.COUNTRYREGIONID AS [Country region Id],
    
    --CUSTINVOICEJOUR.INVOICEAMOUNTMST AS [Invoice amount],
    
    CUSTTRANS.SETTLEAMOUNTMST AS [Payment amount],
    
    CUSTINVOICEJOUR.INVOICEAMOUNTMST - CUSTTRANS.SETTLEAMOUNTMST AS [Balance],
    
    CUSTTRANSOPEN.TRANSDATE AS [Transaction date],
    
    CUSTTRANSOPEN.DUEDATE AS [Due date],
    
    CUSTTRANS.CURRENCYCODE AS [Currency code],
    
    CUSTTRANSOPEN.DATAAREAID AS [Data area Id]
    
    FROM CUSTTRANSOPEN , CUSTTRANS, CUSTINVOICEJOUR--, LOGISTICSPOSTALADDRESS
    
    WHERE  CUSTTRANSOPEN.ACCOUNTNUM = CUSTTRANS.ACCOUNTNUM
    
    AND CUSTTRANSOPEN.REFRECID = CUSTTRANS.RECID
    
    AND CUSTINVOICEJOUR.INVOICEACCOUNT = CUSTTRANSOPEN.ACCOUNTNUM
    
    AND CUSTINVOICEJOUR.INVOICEID = CUSTTRANS.INVOICE
    
    AND CUSTINVOICEJOUR.INVOICEACCOUNT = CUSTTRANS.ACCOUNTNUM
    
    AND CUSTINVOICEJOUR.INVOICEDATE = CUSTTRANS.TRANSDATE
    
    AND CUSTINVOICEJOUR.LEDGERVOUCHER = CUSTTRANS.VOUCHER
    
    ORDER BY CUSTTRANS.CREATEDDATETIME

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dekion Profile Picture

dekion 4

#2
Virginia99 Profile Picture

Virginia99 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans