Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Retrieving delivery address from the Sales order

(0) ShareShare
ReportReport
Posted on by 1,230

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

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

    You're welcome.

  • Sohaib Cheema Profile Picture
    Sohaib Cheema 46,612 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);
  • raff Profile Picture
    raff 1,230 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 :)

  • Iulian Cordobin Profile Picture
    Iulian Cordobin 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).

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

    But it does have a DeliveryPostalAddress field:

    1423.sales2.png

  • raff Profile Picture
    raff 1,230 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?

  • Verified answer
    Iulian Cordobin Profile Picture
    Iulian Cordobin 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?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans