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
You're welcome.
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);
ah yes, apols I was searching for postaladdress!
great, you have been a lot of help for me, probably without you even realising :)
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).
But it does have a DeliveryPostalAddress field:
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?
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?
André Arnaud de Cal...
291,969
Super User 2025 Season 1
Martin Dráb
230,842
Most Valuable Professional
nmaenpaa
101,156