public LogisticsPostalAddress getAddress(PartyNumber partyNumber, LogisticsLocationRoleType logisticsLocationRoleType)
{
LogisticsPostalAddress address = null;
DirPartyLocation partyLocation;
DirPartyLocationRole partyLocationRole;
LogisticsLocationRole locationRole;
select firstonly partyLocation
where partyLocation.Party == DirPartyTable::find(_partyNumber).RecId
join address
where address.Location == partyLocation.Location
join partyLocationRole
where partyLocationRole.PartyLocation == partyLocation.RecId
join locationRole
where locationRole.RecId == partyLocationRole.LocationRole
&& locationRole.Type == _logisticsLocationRoleType;
if(partyLocation)
{
return address;
}
return address;
}
}