Friday, November 20, 2020

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

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



Why do users often get confused about Dynamics 365 Customer Engagement (D365 CE), Dataverse, and the Power Platform?

  The Microsoft ecosystem for business applications can sometimes be difficult to navigate, especially when discussing Dynamics 365 Customer...