Tuesday, April 4, 2023

Get email,phone number,fax,URL,Linkedin etc from InventLocation or warehouse

public LogisticsElectronicAddress getElectronicAddressByPostalAddress(InventLocation _inventLocation, LogisticsElectronicAddressMethodType _type)

{

LogisticsLocation logisticsLocation;

InventLocationLogisticsLocation inventLocationLogisticsLocation;

LogisticsElectronicAddress LogisticsElectronicAddress;


 select firstOnly RecId from inventLocationLogisticsLocation

        where inventLocationLogisticsLocation.InventLocation == _inventLocation.RecId

    join RecId from logisticsLocation

        where logisticsLocation.ParentLocation == inventLocationLogisticsLocation.Location;


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


    return LogisticsElectronicAddress;

}