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 :
Microsoft Dynamics AX (Archived)

Creating a query object that takes user input before initializing?

(0) ShareShare
ReportReport
Posted on by 135

Hello.

I need to create a way for users to be able to quickly view all line items for a single customer.  While there is a way to do this in AX already, we have made customizations to our customer merging so that when we want to see all the line items for a single customer, we also want to see all the line items for any customer that is merged to that original customer.  This isn't possible for the existing implementation, and I feel that it would be easier to create a new menu item to do this functionality rather than try to overhaul the existing one.

I'm thinking the easiest way to do this is to create a new menu item, then upon clicking that menu item, a simple dialog box shows up asking the user to input an account number.  Then after entering the account number, you click OK, which uses that user input for the query object which initializes and pulls up the grid that shows all the line-items for that customer and the merged accounts.  The problem is, I'm not sure this will actually work as I've never been able to utilize user input in a query object before, and I'm not sure where to put the code for the dialog box.  I tried checking the MS docs online for examples using query objects, but none of them did anything fancy like this (they just used static values).  Can anyone provide me with the general steps of how to implement this, or provide an alternative way that may be easier?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    It's not really anything fancy - you would take a value from the dialog field and used in a query range of a form datasource - that's it.

    Note that an alternative to creating a dialog for customer number is simply showing the advanced filter/sort window, which would allow users to set other filter as well (which is often desirable, but in this case it could be just confusing).

    Also, rather than adding an extra dialog form, you may want to put the field on top of the form itself. This would also allow users to easily switch to another customer.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
GL-01081504-0 Profile Picture

GL-01081504-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans