SQL query to find Customer contact list from AX 2012


Description:-

here is the SQL  Query to extract a quick customer contact list from Dynamics AX 2012.

SELECT   
  CUSTTABLE.ACCOUNTNUM AS CUSTID, 
  DIRPARTYTABLE.NAME AS CUSTNAME,
  CASE LOGISTICSELECTRONICADDRESS.TYPE WHEN 1 THEN 'Phone' WHEN 2 THEN 'Email' END AS CONTACTTYPE,
  LOGISTICSELECTRONICADDRESS.DESCRIPTION AS CONTACTNAME, 
  LOGISTICSELECTRONICADDRESS.LOCATOR AS CONTACTDETAILS 
FROM DIRPARTYTABLE AS DIRPARTYTABLE 
INNER JOIN CUSTTABLE ON DIRPARTYTABLE.RECID = CUSTTABLE.PARTY 
INNER JOIN DIRPARTYLOCATION ON DIRPARTYTABLE.RECID = DIRPARTYLOCATION.PARTY 
INNER JOIN LOGISTICSELECTRONICADDRESS ON DIRPARTYLOCATION.LOCATION = LOGISTICSELECTRONICADDRESS.LOCATION 
ORDER BY DIRPARTYTABLE.NAME  

Related Posts

Previous
Next Post »

2 comments

comments

Thanks for comments.....