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 :
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
    237,740 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,827 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 700 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 567 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 408 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans