Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

InventSite + LogisticsEntityPostalAddressView = how to get LocationName based on SiteId

Posted on by 85

DAX Tribe,

I've been tasked with doing some Invoice report processing (email). I've got the SalesTable.InventSiteId (which links to the InventSite table), and now I need the LocationName as can be found in the InventSite form (COMPANY/Inventory management/Setup/Inventory breakdown/Sites).

Somehow the below InventSite.SiteId needs to be linked to something in the LogisticsEntityPostalAddressView view.

Any clues from you very helpful people?

Thanks,

Dave Cline

SELECT *

FROM [AOS_DB].[dbo].[INVENTSITE] 

JOINED SOMEHOW ??? TO

SELECT [LOCATIONNAME]
FROM [AOS_DB].[dbo].[LOGISTICSENTITYPOSTALADDRESSVIEW]

WHERE INVENTSITE.SITEID = '100'

*This post is locked for comments

  • Suggested answer
    DaveCline Profile Picture
    DaveCline 85 on at
    RE: InventSite + LogisticsEntityPostalAddressView = how to get LocationName based on SiteId

    SELECT * FROM LogisticsEntityPostalAddressView A

    JOIN INVENTSITE B

     ON B.RECID = A.Entity

    WHERE A.EntityType = 1 AND B.SITEID = '100'

    ORDER BY A.IsPrimary DESC

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans