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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Menu item button to open details form for selected record

(0) ShareShare
ReportReport
Posted on by

Hi D365 Community,

I’m working in Dynamics 365 Finance & Operations (Visual Studio / X++) and I’m trying to implement a common pattern:

Form 1 (List / grid): shows multiple records
Form 2 (Details): should open and show the currently selected record from Form 1

What I want:

  • A button on the list form (or a menu item button) that opens the details form.

  • The details form should open filtered to the record I selected in the grid (ideally using RecId).

  • I’m fine with using Args, calling the form, or using menu item parameters—whatever is best practice.

What I tried / where I’m stuck:

  • I can open the form, but it  doesn’t load the selected record

Can someone please share the correct approach (best practice), and where exactly to put the code/properties?

  • Which object should I use for the button (MenuItemButton vs CommandButton)?

  • How to pass the selected record from the list form datasource (cursor) to the details form reliably?

  • Any small working X++ example would be really appreciated.

Thanks in advance!

Categories:
I have the same question (0)
  • Martin Dráb Profile Picture
    238,469 Most Valuable Professional on at
    Moved from Integration, Dataverse, and general topics forum to Finance | Project Operations, Human Resources, AX, GP, SL forum.
     
    Which form patterns are you using? Note that a list and details view are usually implemented in the same form (e.g. see patterns Simple List and Details or Details Master). Maybe you won't have the problem at all when you use the right form pattern.
     
    You shouldn't need any code; the system will add the dynalink automatically if everything is set up correctly. It requires using a menu item and a menu item button; don't consider anything else (such as a command button).

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…

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... 584 Super User 2025 Season 2

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 428 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 331 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans