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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

First Only on the datasource

(0) ShareShare
ReportReport
Posted on by 535
What is the easiest route to get the top 1 record from WHSLoadTable to populate the loadid and loadreferenceNum from the createdate.  I'm unfortunately getting multiple lines since there are many load lines tied to the per WHSLoadLine
 
 
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    238,745 Most Valuable Professional on at
    There is no way to say that you want to join just a first line in a group, based on some sorting. You'll need a different design.
     
    I would create a view with PurchLine as the data source. It would contain InventTransId and a computed column returning TOP 1 LoadId for the given InventTransId (sorted by CreatedDateTime and with a filter on InventTransType). In the form, I'd join the view with PurchLine and then WHSLoadTable with the view, to get LoadReferenceNum.
     
    I showed this approach in Join first line in AX 2012. Just please note that the code there for the computed column is just for simple demonstration (e.g. it doesn't deal with DataAreaId).
  • GirishS Profile Picture
    27,833 Moderator on at
    Hi Keith,
     
    As Martin mentioned the functionality you are asking is achievable via code, but you cannot do the same at form level.
    Like you can use order by RecId desc to get the most recent records from the table in the select statements.
     
    Thanks,
    Girish S.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 545 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 408

#3
Adis Profile Picture

Adis 267 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans