How to get the module which is currently open through X++ .
*This post is locked for comments
Hi, you can refer to below post
community.dynamics.com/.../183225
There is no direct way to retrieve that information as far as I am aware. The only possible way I could imagine is if you hook in from the .Net namespace or through WinAPI handles to figure out what is in the MDI Children of the main AX window.
Acutally I have found a way. Create a job as per below:
static void WIK_getCurrentModule(Args _args)
{
info(infolog.navPane().getSelectedNode().AOTparent().treeNodeName());
}
Add the job under Menu item > Actions and give it a label like "Get current module", and then add the menuitem to a Menu.
When you open a new AX workspace and click your new menu item, it will tell you the module name.
You cannot run this directly in code, since there will be no navigation pane associated with the current screen (your developer workspace).
Thank you for the suggestions. need to get the module name in a sub form .(clicking a button in main form opens sub form) -so it is not a menu item directly from AOT .
If you want to see it in List Page :
info(this.listPage().listPageArgs().parameters());
Regards,
SM
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Tocauer 4
Community Member 2
Nayyar Siddiqi 2