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

Community site session details

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

to fetch delivery name & delivery postal address

(0) ShareShare
ReportReport
Posted on by 30

Hi team,

I have done below code to get the Delivery address and name but the delivery POSTAL address is NOT fetching properly.

LogisticsLocationRecId      locationRecId;
        
LogisticsLocationRole       role = LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Delivery);
        
LocationRecId   = LogisticsLocationDefault::findSimpleDefault(InventSite::find(this.InventSiteId), role).RecId;
LogisticsLocation location = LogisticsLocation::find(locationRecId);

this.DeliveryName =  InventLocation::find(this.InventLocationId).Name;
this.DeliveryPostalAddress = LogisticsPostalAddress::addressRecIdFromLocationRecId(location.RecId);

Kindly let me know where is the issue?

Pls give me more shed on this.

thanks!

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: to fetch delivery name & delivery address

    Hi,

    Try the below code.

    LogisticsPostalAddress address = LogisticsLocationEntity::findPostalAddress(this.InventSiteId, LogisticsLocationRoleType::Delivery);
    this.DeliveryAddress = address.Address;

    Thanks,

    Girish S.

  • @rp@n Profile Picture
    30 on at
    RE: to fetch delivery name & delivery address

    Hi Girish,

    I am looking for delivery postal address not address. Sorry, I posted wrong the caption.

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    RE: to fetch delivery name & delivery postal address

    Hi, please use LogisticsPostalAddress asee tity and get the address from that. First give a SQL statement on that and you can see address in that. That will help you.

  • @rp@n Profile Picture
    30 on at
    RE: to fetch delivery name & delivery postal address

    Kindly verify my code pls. where is wrong? and if yes , kindly suggest me what to do

  • Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    RE: to fetch delivery name & delivery postal address

    Please debug your code to check why it is not working. I cannot comment on that directly by seeing it.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: to fetch delivery name & delivery postal address

    Hi, Please try this code

    this.DeliveryPostalAddress = LogisticsLocationEntity::constructFromLocationRecId(InventLocation::getLocationFromRole(inventLocation.RecId, LogisticsLocationRoleType:: Delivery)).getPostalAddress();

     https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/397195/get-warehouse-address-based-on-logistics-location-role-type 

    If any issues, in above code then try this and let us know your test results

    https://wp.me/p9l6rY-1B

  • @rp@n Profile Picture
    30 on at
    RE: to fetch delivery name & delivery postal address

    Sure Mohit, I will let you know

  • @rp@n Profile Picture
    30 on at
    RE: to fetch delivery name & delivery postal address

    Hi Mohit,

    I tried with the code which you mentioned, got below error. It seems datatype issue.

    pastedimage1682743368778v1.png

    pls give me more shed on this.

    thanks!

  • Suggested answer
    Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: to fetch delivery name & delivery postal address

    The above code is providing you table buffer of LogisticsPostalAddress and you need to map its RecId in DeliveryPostalAddress field, so please use below code

    this.DeliveryPostalAddress = LogisticsLocationEntity::constructFromLocationRecId(InventLocation::getLocationFromRole(inventLocation.RecId, LogisticsLocationRoleType:: Delivery)).getPostalAddress().RecId;

  • @rp@n Profile Picture
    30 on at
    RE: to fetch delivery name & delivery postal address

    thanks Mohit let me try this

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,157

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 883 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 674 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans