hi all,
how i will get address and contact information from warehouse and site through code in AX 2012 R3
please give me more shed on this.
tahnsk!
hi all,
how i will get address and contact information from warehouse and site through code in AX 2012 R3
please give me more shed on this.
tahnsk!
Shall I pass salesTable.inventsiteid to get address for specific site?
Hi Blue,
The above code is working fine for Warehouse but not working for 'SITE"
I just changed the LogisticsLocationEntityType::Site
but not working. anything else need to change?
Thanks Blue,
static void testContactLogic(Args _args)
{
//WHSShipmentTable shipmentTable = WHSShipmentTable::find('USMF-000002');
SalesTable salesTable = SalesTable::find("SO-0000002");
InventLocation inventLocation;
LogisticsEntityPostalAddressView postalAddressView;
LogisticsElectronicAddress electronicAddress;
LogisticsLocation contactLocation;
LogisticsAddressing address;
inventLocation = inventLocation::find(salesTable.InventLocationId);
if (inventLocation)
{
select firstonly postalAddressView
where postalAddressView.Entity == inventLocation.RecId
&& postalAddressView.EntityType == LogisticsLocationEntityType::Warehouse
&& postalAddressView.isPrimary == NoYes::Yes;
if (postalAddressView)
{
address = postalAddressView.Address;
info(address);
select firstOnly electronicAddress where electronicAddress.Type == LogisticsElectronicAddressMethodType::Phone
join contactLocation where contactLocation.ParentLocation == postalAddressView.Location
&& contactLocation.RecId == electronicAddress.Location;
info(strFmt("Primary contact name: %1 Primary contact phone: %2",electronicAddress.Description, electronicAddress.Locator));
}
}
}
It's done which the matching with SalesOrder >> InventLocationId
Thanks blue
Actually we having 10 warehouse and sites. So, which warehouse and site need to print in Sales invoice report that I can match with SO header warehouse and site?
Is it correct?
kindly let me know how i will get the contact information from warehouse and site through code?
What you should have learnt from your older threads (such as when you asked the similar thing about customers) is that there may be helper methods you can use. And it's indeed the case - InventLocation table has a method called address(). Make sure you look at methods next time.
André Arnaud de Cal...
292,516
Super User 2025 Season 1
Martin Dráb
231,409
Most Valuable Professional
nmaenpaa
101,156