Announcement

Collapse
No announcement yet.

Redirect back to a certain record at some event in modal form

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

  • Redirect back to a certain record at some event in modal form

    Hi

    I am trying to make a single record form (A) with master/detail forms.
    I need to create a custom button that open another application (B) in modal form, so that when I click one of the custom button at (B),
    it will redirect the parent window back to the single record form (A) , but not at the default record 1, at some specific record instead.

    Is there any good way to do it?

  • #2
    On the application (B) I created a button to set a session variable before redirecting back to single record form (A),
    and at (A) I wrote something like this:
    record_redir();

    Where record_redir is a cutom function as follow:

    if(isset($_SESSION["rec"])){
    $rec=$_SESSION["rec"];
    unset($_SESSION["rec"]);
    sc_ajax_javascript("nm_navpage",array($rec,'P'));

    }

    Any idea why this doesn't work?

    Comment


    • #3
      I've had some issues with accessing to $_SESSIONS in scriptcase. Try using the regular variables of scriptcase and setting them as "session" (left menu > Application > Global variable). Your code may be like this:

      Originally posted by Brian View Post
      if(isset($_SESSION["rec"])){
      $rec=$_SESSION["rec"];
      unset($_SESSION["rec"]);
      sc_ajax_javascript("nm_navpage",array($rec,'P'));

      }
      PHP Code:
      if(isset([rec])){
          
      $rec=[rec];
          
      sc_reset_global([rec]);
          
      sc_ajax_javascript("nm_navpage",array($rec,'P'));


      Best Regards

      Daniel Salcedo
      • Software & Hardware developer
      • Photography enthusiast
      • Ultimate Frisbee lover

      Comment


      • #4
        I don't know why, but it seems that when I try to run javascript, even simple ones like window.close(),
        my application will display a blank page with "ok" button and then nothing happen. What is the problem here?

        Comment


        • #5
          Add sc_exit(sel)

          Buttons are running under other context. In 8.1 will be an Ajax button to do it in the sams
          /Giuseppe

          Professional Scriptcase Services
          Some Customers opinions

          Comment

          Working...
          X