web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

SQL query to get vendor email addresses and phone details in ax/d365 x++

Rahul Kiran Profile Picture Rahul Kiran 481

Below is the sql query to get vendor email address. Please change it according to your requirement.



select VENDTABLE.ACCOUNTNUM as VendorId, DIRPARTYTABLE.NAME, LogisticsElectronicAddress.DESCRIPTION as Type,LogisticsElectronicAddress.LOCATOR as Email , LogisticsElectronicAddress.ISPRIMARY, LogisticsLocationRole.TYPE, DIRPARTYLOCATION.PARTY, VENDTABLE.dataareaid from VENDTABLE 

join DIRPARTYLOCATION on VENDTABLE.PARTY = DIRPARTYLOCATION.PARTY

join LogisticsElectronicAddress on DIRPARTYLOCATION.LOCATION = LogisticsElectronicAddress.LOCATION

join LogisticsElectronicAddressRole on LogisticsElectronicAddress .RecId = LogisticsElectronicAddressRole .ElectronicAddress

join LogisticsLocationRole on LogisticsElectronicAddressRole.LocationRole = LogisticsLocationRole .RecId

join DIRPARTYTABLE on VENDTABLE.PARTY = DIRPARTYTABLE.RECID

where LogisticsElectronicAddress.TYPE = 2 // address 1 is phone number

// where LogisticsElectronicAddress.ISPRIMARY = 1 // for primary contacts only // 0 for non primary

order by VENDTABLE.ACCOUNTNUM




This was originally posted here.

Comments

*This post is locked for comments