x++ code to get Vendor Email Address based on Purpose in Dynamics 365 for Operations
public static Email getVendorEmailAddress() { VendTable vendTable; DirPartyLocation dirPartyLocation; LogisticsElectronicAddress elecAddress; LogisticsElectronicAddressRole elecAddressRole; LogisticsLocationRole locRole; Str vendNum; vendNum='205181';//Vendor Number select firstonly DirPartyLocation where dirPartyLocation.party == VendTable::find(vendNum).Party//Vendor Number join elecAddress where elecAddress.Location == dirPartyLocation.Loca...