Monday, 31 August 2020

How to get packing slip number of a customer invoice in D365FO/AX X++

 Sometimes, we may get a requirement to dispalay/get packing slip numbers of customer invoices. I wrote a simple query to get the details from the database. 

If you want to use this query in AX, create a display method in CUSTINVOICEJOUR table and change the code as per your requirement and add it to your SSRS report or user interface.

select CUSTPACKINGSLIPTRANS.PACKINGSLIPID,CUSTPACKINGSLIPTRANS.DELIVERYDATE as PackingslipDate, CUSTINVOICEJOUR.INVOICEID, CUSTINVOICEJOUR.INVOICEDATE, CUSTINVOICEJOUR.SALESID from CUSTINVOICEJOUR

join CUSTINVOICETRANS on CUSTINVOICEJOUR.INVOICEID = CUSTINVOICETRANS.INVOICEID 

and  CUSTINVOICEJOUR.INVOICEDATE = CUSTINVOICETRANS.INVOICEDATE

and CUSTINVOICEJOUR.SALESID = CUSTINVOICETRANS.SALESID

join  CUSTPACKINGSLIPTRANS on CUSTINVOICETRANS.INVENTTRANSID = CUSTPACKINGSLIPTRANS.INVENTTRANSID

               and CUSTINVOICETRANS.SALESID = CUSTPACKINGSLIPTRANS.SALESID

where CUSTINVOICEJOUR.DATAAREAID = 'ABC'-- data area id code

 and CUSTINVOICEJOUR.INVOICEDATE between '2019-12-29 00:00:00.000' and '2020-01-31 00:00:00.000' -- YYYY-MM-DD


@Rahul

No comments:

Post a Comment

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