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 :
Microsoft Dynamics AX (Archived)

Retrieving delivery address from the Sales order

(0) ShareShare
ReportReport
Posted on by 1,236

hi

I am struggling to link back to the delivery address from the sales order

I can see the address in the table 'LogisticsPostalAddress'

anyone any ideas on what tables I need to join together to find this out? or have any tips on how to make this process generally easier (how to see what tables have the common fields)

thanks

mal

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Iulian Cordobin Profile Picture
    8,201 on at
    RE: Retrieving delivery address from the Sales order

    4863.logistic.PNG

    The delivery address is taken from the Logistics table, present in the form as a referenced DS. It is joined in the form using the DeliveryPostalAddress_FK on the SalesTable (which is PostalAdress field linked to the RecId of the LogisticPostalAddress). What problem do you have exactly?

  • raff Profile Picture
    1,236 on at
    RE: Retrieving delivery address from the Sales order

    Hi Lulian

    my problem is me :) I just need more experience in working with AX db

    ok, I can see the data sources now as above (I was looking in tables hoping to find this info)

    but sales table does not have a field called postal address, how can you see the foreign keys of a table in AOT?

  • Suggested answer
    Iulian Cordobin Profile Picture
    8,201 on at
    RE: Retrieving delivery address from the Sales order

    But it does have a DeliveryPostalAddress field:

    1423.sales2.png

  • Iulian Cordobin Profile Picture
    8,201 on at
    RE: Retrieving delivery address from the Sales order

    One way to see the FK in the AOT is to go to the Relations node for the table. There you can see the relation. However, there might be some cases (still out there) where the FK is not expressed in an AOT relation node (old legacy tables).

  • raff Profile Picture
    1,236 on at
    RE: Retrieving delivery address from the Sales order

    ah yes, apols I was searching for postaladdress!

    great, you have been a lot of help for me, probably without you even realising :)

  • Sohaib Cheema Profile Picture
    49,139 User Group Leader on at
    RE: Retrieving delivery address from the Sales order

    when you have Location Recid for addressing framework, it can be simple to get address.

     SalesTable              SalesTable;
        LogisticsPostalAddress  logisticsAddress;
        utcdatetime _validFrom  = DateTimeUtil::minValue();
        utcdatetime _validTo    = DateTimeUtil::maxValue();
        
        //#1
        select SalesTable
            where SalesTable.SalesId == '000824';//use your own SO Number. This is sample
        info(SalesTable.deliveryAddress().Address);
        
        //#2
        select firstonly validtimestate(_validFrom, _validTo) logisticsAddress
            where logisticsAddress.RecId == SalesTable.DeliveryPostalAddress;
        info(logisticsAddress.Address);
  • Iulian Cordobin Profile Picture
    8,201 on at
    RE: Retrieving delivery address from the Sales order

    You're welcome.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Willem van Duren Profile Picture

Willem van Duren 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans