Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all articles
Browse latest Browse all 17314

AX 2012 Close Open Forms

$
0
0

Hi Guys

About this topics I spent some time and at the end I’m not able to call by code the standard AX 2012 command in order to Close All Forms, see picture below.



 
In order to achieve this goal, I have modified the SysSetupFormRunClass, Run Method and saved the Window handle of all open forms in a List and move it in the Global Cache, like below :

    // Exclude ListPage Forms
    If (this.form().formTemplate() != 1

       )

    {
                …..

classFactory.globalCache().set(...

 

Finally, using the sendMessage WinApi Function I have closed all Forms, like below :

    #WINAPI

    ……
    listIterator ....
    WinApi::sendMessageEx( WindowHandle, #WM_CLOSE, 0, 0);
 
 
 
 
That's it!

Stay Tuned!

Viewing all articles
Browse latest Browse all 17314

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>