I have a custom screen that crashes when the screenexit subroutine is called.
The event sequence is:
Form1_formClosed is fired, which then attempts to execute:
Call ScreenExit("", "")
In particular the code within the ScreenExit Subroutine that causes the crash is:
the message received is [screennumber].exe has stopped working."
Mark P. Lauze
Beltmann Group Inc.
Please follow the below steps.
1. Remove the Solomon.VBTools.vb file from your custom screen.
2. Again add the Solomon.VBTools.vb from the following path C:\Program Files (x86)\Microsoft Dynamics\SL\Applications\VT\VB.
This may help you to solve this issue.
Try this work around in your custom screen. Please include the below code in form1_formClosed event instead of ScreenExit ().
Thanks for your quick response.
I tried what you have suggested.
1. Replacing the Solomon.VBTools.VB had no implact.
Note: the datestamp on this file is 9/17/2012 5:17 PM.
Is there a newer version?
2. Replacing Call ScreenExit("","") with Me.Close() in the form1_formClosed event:
This causes an infinite loop and eventually a stack overflow where it continuously calls the form1_Closing event.
Which version of Dynamics SL are you using?.
I have already tried the second option in my custom screen and it's working perfectly for me.I will check with my environment and keep you posted.
We are upgrading from 6.5 to 2011 SP2.
In researching the issue further, I find that:
When I load the screen and enter a contract number, which causes the screen information to load, and immediately close, the app crashes.
When I load the screen, wait about 10 seconds, then close, it closes normally.
When I load the screen, enter a contract number, then click an option to show all infomation in a grid, then exit the application within a few seconds, it crashes.
Again, if I wait at least 10 seconds, then close, it closes normally.
My guess is that there is some cleanup code that is processing behind the scenes and when the form is closed, the processing has not completed.
When the screenexit routine is called (likely before some code has completed), it seems to enter into an endless loop, which causes the application to eventually crash.
Is there a way to detect processes pending completion and pausing before executing the ScreenExit routine?
The developer that created the apps for the company uses very little error trapping, so I was wondering if it is because Dynamics SL has its own way of handling errors.
What are the best practices for error trapping in Solomon screens. Wondering if we can trap an error at some point.
Have you tried to trace the Sql queries that running on custom screen using the SQL Profiler? If not, Please try to trace the SQL queries using SQL Profiler.
This may help you to identify the long running SQL Queries.
I have run profiler and it appears that the results are same whether I wait to close or close quickly.
Can you try this workaround? This may work but I’m not sure.
1. Locate the APC folder (C:\Users\User Name\AppData\Roaming\Microsoft Dynamics SL\APC)
(%userprofile%\AppData\Roaming\Microsoft Dynamics SL\APC)
2. By default the APC folder is hidden due to some security reason. You may need to enable the visibility of hidden files / folders.
3. Delete the swimapi.kpr and swimapiex.exd files. These files are responsible for the loading of customizations prior to screen load.
4. On launching the customized screen again, these files will be recreated.
Please do a simple try.
I ran the code inspector and found that there was an offset error.
Once this was corrected, the screen performed normally.
Thanks for all of your help.