How to get the warehouse Address (Street, City, State) through code InventLocationId??

Hi Master

I have a problem to get a warehouse Address (Street, City, State). This is my code to find Warehouse Address, I have tried but when did select LogisticsPostalAddress not find. after I check the relationship between LogisticsPostalAddress.Location and LogisticsLocation.Regid correct?


static void Warehouse(Args _args)
{
str Warehouse;

//LogisticsElectronicAddress LogisticsElectronicAddress;

LogisticsLocation LogisticsLocation;

InventLocationLogisticsLocation InventLocationLogisticsLocation;

InventLocation InventLocation;

LogisticsPostalAddress LogisticsPostalAddress;

;

Warehouse = “02001”;

InventLocation = InventLocation::find(Warehouse);

Select firstOnly InventLocationLogisticsLocation

where InventLocationLogisticsLocation.InventLocation == InventLocation.RecId;

if (InventLocationLogisticsLocation)

{

select firstOnly LogisticsLocation

where LogisticsLocation.ParentLocation == InventLocationLogisticsLocation.Location;

if (LogisticsLocation)

{
select firstOnly LogisticsPostalAddress

where LogisticsPostalAddress.Location == LogisticsLocation.RecId;

if(LogisticsPostalAddress)
{
info(strFmt("%1", LogisticsPostalAddress.Street));

}

}

}
}

can somebody help me ?

Thanks,

Pranyoto

Have a look at,
\Data Dictionary\Tables\InventLocation\Methods\address

Dear Kranthi

I have tried but I want to show select Street, City, and State Only.
Can I add or edit a method in \ Data Dictionary \ Tables \ InventLocation \ Methods ?

Thanks,

Yes

You can get the related logisticsPostalAdrees from this.logisticsPostalAddress()

Street, city and State are the field in that table

logisticsPostalAdrees = this.logisticsPostalAddress();

city = logisticsPostalAdrees.city

state = logisticsPostalAdrees.state …

Dear Kranthi

Thanks for your solution, this works

Regards,
Pranyoto