Electronic Address from InventLocation (warehouse)

public LogisticsElectronicAddress getElectronicAddressByPostalAddress(InventLocation _inventLocation, LogisticsElectronicAddressMethodType _type)
{
LogisticsLocation logisticsLocation;
InventLocationLogisticsLocation inventLocationLogisticsLocation;
LogisticsElectronicAddress electronicAddress;

    select firstOnly RecId from inventLocationLogisticsLocation
        where inventLocationLogisticsLocation.InventLocation == _inventLocation.RecId
    join RecId from logisticsLocation
        where logisticsLocation.ParentLocation == inventLocationLogisticsLocation.Location;

     electronicAddress = LogisticsElectronicAddress::findByLocationAndType(logisticsLocation.RecId, _type);

    return electronicAddress;
}

Leave a comment