web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

how i will get address and contact information from warehouse and site through code in AX 2012 R3

(0) ShareShare
ReportReport
Posted on by 30

hi all,

how i will get address and contact information from warehouse and site through code in AX 2012 R3

warehs.jpg

please give me more shed on this.

tahnsk!

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    238,732 Most Valuable Professional on at

    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.

  • @rp@n Profile Picture
    30 on at

    kindly let me know how i will get the contact information from warehouse and site through code?

  • Verified answer
    Blue Wang Profile Picture
    Microsoft Employee on at

    HI @rp@n,

    Check these if they are helpful:

    stoneridgesoftware.com/.../

    mohsinkhalid.com/.../

  • @rp@n Profile Picture
    30 on at

    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?

  • @rp@n Profile Picture
    30 on at

    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

  • @rp@n Profile Picture
    30 on at

    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?

  • @rp@n Profile Picture
    30 on at

    Shall I pass salesTable.inventsiteid to get address for specific site?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 634 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 370 Super User 2026 Season 1

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 331

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans