Announcement

Collapse
No announcement yet.

Alternative Error Message To "The Following Global Variables are Missing"

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Alternative Error Message To "The Following Global Variables are Missing"

    Under some cases, global variables will be missing after a customer has logged out (ex: he opens 2 windows), or under a variety of other circumstances, such as bookmarking a URL and going back to it later without any of the previous globals set.

    How can I create a custom page or text for when this happens? At the very least, I'd like a custom header.

    Thanks!

  • #2
    If global variables are missing you have simply an error in your application which needs to be solved. I always advise to allocate the globals on a central spot, i.e. the logon page. Then you will never run into issues like these.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Agreed, but what if someone has 2 windows open and logs out from a different page? Or bookmarks an internal page?
      Your solution is good, but won't cover those cases. As silly as it is, you can image novice users bookmarking a page and then going back to it, seeing the error, and panicking.

      Comment


      • #4
        You can consider to use a small piece of code in the onscriptinit to sc_redir to the main page if you main global is not allocated or has the wrong value.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          I have the same issue but this happens when an application is kept idle for sometime where the session has expired. Here are the steps to undrerstand what is happening

          1) Keep the running application idle until the session expires
          2) Now click on any menu and where the application uses the global variable
          3) See the below, I clicked one link after the session expired and I am getting the error saying the below global variables are not found. When I log off from my application and login back then this error goes away
          4) I tried the below script in the onApplicationInit event but that script has not executed at all since I did not get any echo message

          if ( !isset([society_id]) )
          {
          echo 'Session Expired. Please logoff and login back';
          }
          else
          {
          echo 'Else';
          }
          Your help here how to detect this scenario and show an appropriate message to the user will be highly helpful.




          Thank you

          Comment

          Working...
          X