Problems with a Focus on a Window

Recently I received a request from a customer to join a transferring order to an invoice and print a packing slip form after transferring the order to the invoice on the SOP Entry form. This form has already been modified and some processes have been added to it through triggers. At first, it looked like a small request, but after the first testing process I realized that it worked correctly only in simple situations. The main problem was that the original print button of the Dynamics GP window needed to be in focus before it is called. When a few operations which call different windows are joined, the focus can be lost because of the delay of opening windows or printing reports. There are also some unexpected windows which pop up and stay open, disturbing some of the following operations.

Another problem appeared when I tried to debug the code I wrote. During debugging process it worked worse than in the previous situation. Using the debugger, the focus is always kept on the debug script and none of the focuses can be reached, which means that none of the reports can be printed.

The main problem was printing reports from different forms. We needed the possibility to join one printing report from one form to another printing report from a different one. There is a small delay between the moment when options for printing are chosen and the moment of printing the report, especially if the screen is chosen for report destination. In that case, the second window already gets a focus on the print button when the first report starts to be printed. Focus on the second window is lost so the printing and processes added to that window through triggers would not be done completely.

In such situations, the only way I found to be efficient is good knowledge about processes we are working with. We need to count every possible situation which can happen during the process we need to implement, which is in most situations pretty complicated and sometimes impossible.

VN:F [1.0.8_357]
Rating: 0.0/10 (0 votes cast)

Share/Save/Bookmark

Tags: , ,

Leave a Reply