Page 1 of 1
VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
Posted: Thu Apr 27, 2017 10:07 am
by davidbalansa
I would like to capture all server routine failues in a single location. In VL Web, I would put the following event handling routine into my web page, set the #handled := true and process accordingly without having the page crash.

- Capture1.JPG (35 KiB) Viewed 11007 times
If I put the same code into my copy of UF_OEXEC and cause the server routine to fail, the code in the event handling routine executes.

- Capture3.JPG (16.9 KiB) Viewed 11007 times
But then the page proceeds to crash even though I specify #handled := true. The same code works in a standalone VL Web page.

- Capture4.JPG (26.69 KiB) Viewed 11007 times
In VLFONE, is there anything else I need to do after setting #handled := true to stop the VLFONE app from crashing?
Regard,
David
Re: VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
Posted: Thu Apr 27, 2017 11:18 am
by MarkDale
Hi David,
You can't handle errors that way in VLF-ONE, because VLF-ONE is already internally listening for #SYS_Web.RequestFailed.
VLF-ONE expects that if you have a scenario where you think failure is likely, you will have coded for it as in shipped example DF_T43H1O. (Example Applications --> Advanced --> Handling Errors)
And if you haven't coded for it, it will shut down.
But even if you do code to handle the error, your session with the server is dead (invalid) from then on, so although the user can continue to do things on the client, the next time they try to interact with the server it will fail anyway because the session is invalid. So the best thing to do when handling the error is to shut down gracefully.
Re: VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
Posted: Thu Apr 27, 2017 1:32 pm
by davidbalansa
Hi Mark,
Thank you for the explanation. That makes sense.
One last question. If I do need to handle the error and want to exit gracefully, I see I can use:
#VLF_ONE.uTerminate Possibletocancel(False) Browserisclosing(False)
to display the "You session has ended" message.

- Capture5.JPG (21.88 KiB) Viewed 10987 times
Is there a method or technique I can use to send the user back to the login screen?
David
Re: VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
Posted: Thu Apr 27, 2017 1:54 pm
by MarkD
It would be better to stay away from the internals in case they change in the future.
You can switch to the exit command just like any other command.
eg: #avFrameworkManager.avSwitch Caller(#COM_OWNER) Toobjectnamed(VLFONE_DEMONSTRATION) Execute('*EXIT')
Re: VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
Posted: Thu Apr 27, 2017 1:59 pm
by MarkD
Regarding logging on again, #SYS_WEB.URL might be able to be used to navigate to a new tab.
eg:
#SYS_WEB.Navigate Url(#SYS_WEB.URL) Target(New)
#avFrameworkManager.avSwitch Caller(#COM_OWNER) Toobjectnamed(VLFONE_DEMONSTRATION) Execute('*EXIT')
Re: VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
Posted: Fri Apr 28, 2017 10:31 am
by davidbalansa
Hi Mark,
Thank you for the code example!
#SYS_WEB.Navigate Url(#SYS_WEB.URL) Target(New)
#avFrameworkManager.avSwitch Caller(#COM_OWNER) Toobjectnamed(VLFONE_DEMONSTRATION) Execute('*EXIT')
solves my issue.
Thanks,
David