11/9/2026 6:31:52 AM
|
| |
| slxdeveloper.com Community Forums |
|
| |
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
closing form on error
Posted: 10 Jul 08 4:54 PM
|
I want to add code to a custom form (in slx 6.2) so that if an error is encountered, the form will close and the system will refresh automatically. My problem is that my lines to close the form and do the refresh seem to be ignored. Here's the code I've tried:
vError = err.number
If vError <> 0 Then
Err.Clear MsgBox "An error was encountered. When you click OK, this screen will close and your system will be refreshed. If the problem persists, please notify the Help Desk." application.BasicFunctions.CloseCurrentView TRUE application.BasicFunctions.RefreshMainView
End If
For testing, I added a line in my script that causes an error. When I run the code I get the message box then nothing else. I can put another rmessagebox afer the refreshmainview command, and that message box pops up too. Any ideas on why those 2 commands are not executed?
|
|
|
| |
|
Re: closing form on error
Posted: 10 Jul 08 7:53 PM
|
Ryan, same result using ModalResult = mrCancel. Maybe some more background will help: The code is being called from a datagrid using the CustomDrawCell event. The reason I'm trying to have the form close automatically on error is that I've had a user get an error in the code that runs on that event and got caught in an endless error loop (maybe not endless but it would have take several hundred mouseclicks to get out).
I've not been able to recreate the error and I've got several hundred very non=technical users who would have no clue how to use the task manager to kill slx. Does this give you any other ideas on why the commands to close the form aren't working, or maybe some other way to handle the problem? |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|