Question Status

Verified
Mark Lauze asked a question on 25 Mar 2014 1:35 PM

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:

  SolomonKernelExports.ScreenExit(OpCode, ParmStr)

the message received is [screennumber].exe has stopped working."

Mark P. Lauze

Lead Developer

Beltmann Group Inc.

Reply
PerumalSamy R responded on 25 Mar 2014 10:51 PM

Hello Frozen,

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 ().

Me.close ()

Thanks

Perumalsamy R

Thanks,

Perumalsamy R

Reply
Mark Lauze responded on 26 Mar 2014 6:44 AM

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.

Mark P. Lauze

Lead Developer

Beltmann Group Inc.

Reply
PerumalSamy R responded on 26 Mar 2014 9:43 AM

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.

Thanks,

Perumalsamy R

Thanks,

Perumalsamy R

Reply
Mark Lauze responded on 27 Mar 2014 1:20 PM

We are upgrading from 6.5 to 2011 SP2.

In researching the issue further, I find that:

Scenario 1:

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.

Scenario 2:

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.

Mark P. Lauze

Lead Developer

Beltmann Group Inc.

Reply
PerumalSamy R responded on 28 Mar 2014 12:41 AM

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.

Thanks,

Perumalsamy R

Thanks,

Perumalsamy R

Reply
Mark Lauze responded on 28 Mar 2014 6:50 AM

I have run profiler and it appears that the results are same whether I wait to close or close quickly.

Mark P. Lauze

Lead Developer

Beltmann Group Inc.

Reply
PerumalSamy R responded on 31 Mar 2014 5:09 AM

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.

Thanks,

Perumalsamy R

Thanks,

Perumalsamy R

Reply
Verified Answer
Mark Lauze responded on 4 Apr 2014 12:38 PM

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.

Mark P. Lauze

Lead Developer

Beltmann Group Inc.

Reply
Verified Answer
Mark Lauze responded on 4 Apr 2014 12:38 PM

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.

Mark P. Lauze

Lead Developer

Beltmann Group Inc.

Reply