A blog (primarily about Dynamics AX) covering topics like X++, AX for Retail, Trade and Logistics, retail concepts, warehousing, etc. Something for everyone. Grab bag blog for whatever I think would help out people in the Dynamics AX/Retail community. The opinions expressed on this site are my own and do not necessarily represent the views of Blue Horseshoe.
Monday, December 28, 2009
How to prompt a user with a query window
This seems pretty straight forward but I've been asked it a few times so I'll write about it: "How can I display an interactive query window to the user in code that looks like the Advanced Query Tool?"
This can be done by taking the QueryRun value and running its method queryRun.prompt() which will return a Boolean value. If the user hits enter, the returned value will be true. If the user cancels out, the value will be false. For this reason, we would want to put this prompt in an if block:
Query query = new Query();
qbds = query.addDataSource(tableNum(CustTransOpen));
queryRun = new QueryRun(query);
// Run code
Subscribe to: Post Comments (Atom)
Wow! Great post! The content is very rich, and I really like it.ReplyDelete
Microsoft Dynamics CRM Online Training | Microsoft Dynamics AX Training