Friday, 20 November 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



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