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

Notifications

Announcements

No record found.

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

    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

    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

    But it does have a DeliveryPostalAddress field:

    1423.sales2.png

  • Iulian Cordobin Profile Picture
    8,201 on at

    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

    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,438 User Group Leader on at

    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

    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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans