No announcement yet.

sc_redir not returning after redirect

  • Filter
  • Time
  • Show
Clear All
new posts

  • sc_redir not returning after redirect

    I have a form app A which needs a variable [x] set to work. So in onAppInit I have this conditional redirect snippet:

    // Redirection parameters
    $redir_app = 'app_B'; // Application name
    $redir_test = [x] == ''; // Redirection test
    $redir_target = '_self'; // Target window (_blank, _self, _parent or modal)
    $redir_param = 'app_A';

    // Redirection
    if ($redir_test)
    sc_redir($redir_app, $redir_param, $redir_target);

    The intention is to redirect to app B automatically where the [x] will be set. In app B's onValidateSuccess, I have

    sc_redir([redir_param]); to return back to app A.

    When I run the app, it goes to app B as it should but in the attempt to go back to app A I get the following error all the time:

    The requested URL /sc8/app/myapp//.php was not found on this server.

    I have tried putting putting the full path within $redir_param and also adding .php to the name but these make no difference.

    How can I solve this?

  • #2
    If you use sc_redir then global variables are not passed automatically. So if you need to set a return address to be used you need to pass this to your application. I.e.

    in your master: sc_redir(myapp.php,glob_return_to=masterapp.php,'_ parent');

    In your detail app you can then use

    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development /


    • #3
      Thank you I will give that a try. But does SC know to automatically append the appropriate path? the .php is a different app so it doesn't reside in the same folder.


      • #4
        yes, it does know as long as it is a scriptcase app.
        Dave Prue
        Code Whisperer
        Lahar International Corp


        • #5
          Thanks, this worked.

          Strange that some boilerplate code in SC do not work as documented!