Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL forum
Answered

ScreenExit causes screen close to crash

Posted on by 155

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."

  • Verified answer
    frozencanuck Profile Picture
    frozencanuck 155 on at
    RE: ScreenExit causes screen close to crash

    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.

  • Ram Peru Profile Picture
    Ram Peru 2,830 on at
    RE: ScreenExit causes screen close to crash

    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

  • frozencanuck Profile Picture
    frozencanuck 155 on at
    RE: ScreenExit causes screen close to crash

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

  • Ram Peru Profile Picture
    Ram Peru 2,830 on at
    RE: ScreenExit causes screen close to crash

    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

  • frozencanuck Profile Picture
    frozencanuck 155 on at
    RE: ScreenExit causes screen close to crash

    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.

  • Ram Peru Profile Picture
    Ram Peru 2,830 on at
    RE: ScreenExit causes screen close to crash

    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

  • frozencanuck Profile Picture
    frozencanuck 155 on at
    RE: ScreenExit causes screen close to crash

    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.

  • Ram Peru Profile Picture
    Ram Peru 2,830 on at
    RE: ScreenExit causes screen close to crash

    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

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,995 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,610 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans