public static logisticsPostalAddress getLogisticsPostalAddress(Str vendNum) { DirPartyTable dirPartyTable; logisticsPostalAddress logisticsPostalAddress; dirPartyLocation dirPartyLocation; logisticsLocation logisticsLocation; VendTable VendTable; select VendTable where vendTable.AccountNum == vendNum // Vendor join dirPartyLocation where vendTable.Party == dirPartyLocation.Party && dirPartyLocation.IsPrimary == NoYes::Yes join logisticsLocation where logisticsLocation.RecId == dirPartyLocation.Location join logisticsPostalAddress where logisticsPostalAddress.Location == logisticsLocation.RecId; return logisticsPostalAddress; }