Primary address stored for inventSite
The following job takes inventsiteID and returns the delivery address specified in the invent site. Hope it will help someone.
static void addressTest(Args _args)
{
InventSite site = InventSite::find("S02");
LogisticsPostalAddress address = LogisticsLocationEntity::findPostalAddress(site, LogisticsLocationRoleType::None);
info(address.Address);
}
Phone Details
private Phone getSitePhone(InventSiteId _inventSiteID)
{
InventSite site = InventSite::find(_inventsiteID);
LogisticsElectronicAddress logisticsElectronicAddress;
LogisticsLocationEntity locationEntity = LogisticsLocationEntity::findLocation(site, LogisticsLocationRoleType::Delivery, DirUtility::getCurrentDateTime(),true);
RecId parentRecID= locationEntity.parmLocationRecId();
LogisticsLocation logisticsLocation;
if (parentRecID )
{
select logisticsLocation
where logisticsLocation.ParentLocation == parentRecID
join logisticsElectronicAddress
where logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Phone &&
logisticsElectronicAddress.location == logisticsLocation.RecId;
}
return logisticsElectronicAddress.Locator;
}
No comments:
Post a Comment