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

Announcements

No record found.

News and Announcements icon
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 56

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!

  • Suggested answer
    GirishS Profile Picture
    27,845 Moderator on at

    Hi,

    Try the below code.

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

    Thanks,

    Girish S.

  • @rp@n Profile Picture
    56 on at

    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

    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
    56 on at

    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

    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,573 Moderator on at

    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
    56 on at

    Sure Mohit, I will let you know

  • @rp@n Profile Picture
    56 on at

    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,573 Moderator on at

    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
    56 on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 266 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 217

#3
Subra Profile Picture

Subra 164 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans