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

Country region id get from logistics postal addresss

(0) ShareShare
ReportReport
Posted on by 30

hi all,

is it possible to get CountryRegionId from LogisticsPostalAddress through code? Is there any specific method to call?

please give me more shed on this.

thanks!

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Country region id get from logistics postal addresss

    CountryRegionId is a field in LogisticsPostalAddress.

    So you can get it by LogisticsPostalAddress.CountryRegionId.

  • @rp@n Profile Picture
    30 on at
    RE: Country region id get from logistics postal addresss

    yes,so i need to pass the parameter to get specific contry region id rite?

  • Blue Wang Profile Picture
    on at
    RE: Country region id get from logistics postal addresss

    HI @rp@n,

    return LogisticsPostalAddress::findRecId(this.DeliveryPostalAddress).CountryRegionId;

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Country region id get from logistics postal addresss

    If you have LogisticsPostalAddress table buffer (which I assume, based on the information that you have shared with us), you can use all fields in that table without "passing parameter".

    This works with any other table buffers as well.

    But, if you have only RecId of LogisticsPostalAddress, then you indeed need to first fetch the table buffer using LogisticsPostalAddress::find() method, as suggested by BlueWang. This is also a pattern that appears everywhere in the system: if you have a key / relation to other table, you can use it to fetch the related table buffer, and then you can access any fields of the related table buffer by tableBufferName.FieldName.

    These are among the first things that you should get familiar with when starting your journey as x++ developer.

    Is it now clear to you? If not, could you please share full details of your business requirement, current code and possible problems / errors that you are experiencing? In general I suggest to share all this info already in your initial message whenever you post a new question. This helps you to get best possible help as soon as possible, and saves everyone's time, removing the need to guess details of your problem.

    Thanks!

  • @rp@n Profile Picture
    30 on at
    RE: Country region id get from logistics postal addresss

    yes, i writre

    country RegoinId = salesTable.deliveryPostalAddress().countryRegionId;

    thanks all

  • Verified answer
    Blue Wang Profile Picture
    on at
    RE: Country region id get from logistics postal addresss

    To  get Country Name by Country code for Sales order in Ax 2012:

    community.dynamics.com/.../how-to-get-country-name-by-country-code-for-sales-order-in-ax-2012

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 1,933

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 537 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans