Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Open Customer Invoices

Posted on by 316

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

  • Verified answer
    AdnDalhi Profile Picture
    AdnDalhi 316 on at
    RE: Open Customer Invoices

    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
  • AdnDalhi Profile Picture
    AdnDalhi 316 on at
    RE: Open Customer Invoices

    Hello , @Mohammed El-Khatib

    Any help please, i will be grateful.

    Thanks

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: Open Customer Invoices

    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
    AdnDalhi 316 on at
    RE: Open Customer Invoices

    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))

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: Open Customer Invoices

    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?

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: Open Customer Invoices

    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans