Announcement

Collapse
No announcement yet.

[SOLVED]Help

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

  • [SOLVED]Help

    sc_redir not work.
    No data inserted.
    It only works when I put _blank.
    neither works
    sc_apl_conf ("AltaCliente", "start", "new");

    No data inserted.

    thanks

  • #2
    If you use sc_redir in an event like onvalidate or before/after insert/update then you need to use sc_commit_trans("Connection") to store the updates. The second part just starts an application in insert mode. But that's all...
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      I use onAfterInsert sc_redir at the event, and it works well when I use _blank target. Otherwise not working.

      Code:
      OnAfterInsert
      $documento = [documento];
      /**
      * Insert a record on another table
      */

      // SQL statement parameters
      $insert_table = 'producto'; // Table name
      $insert_fields = array( // Field list, add as many as needed
      'idcliente' => "'$documento'",

      );

      // Insert record
      $insert_sql = 'INSERT INTO ' . $insert_table
      . ' (' . implode(', ', array_keys($insert_fields)) . ')'
      . ' VALUES (' . implode(', ', array_values($insert_fields)) . ')';

      sc_exec_sql($insert_sql);

      sc_redir(AltaProductoVinculado,idcliente={document o}); // not working.
      sc_redir(AltaProductoVinculado,idcliente={document o}, _Blank); // working.

      thanks

      Comment


      • #4
        have you tried _self _parent ?
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          If and fault equal.
          Go to the other app but without inserting the data

          Comment


          • #6
            even with the proposed commit? If you do a sc_redir you *must* do a sc_commit_trans();
            Albert Drent
            aducom software netherlands
            scriptcase partner, reseller, support and (turn-key) development
            www.scriptcase.eu / www.scriptcase.nl

            Comment


            • #7
              Hello,

              As Mr. Drent asked, are you commiting those data to your db?

              regards,
              Bernhard Bernsmann

              Comment


              • #8
                Is solved I used sc_commit_trans () before redirecting and it works.
                The strange thing that I have no use other applications that also works.
                I imagine that will be a thing of the update.
                By the way still does not work in onApplicationInit:
                sc_apl_conf ("AltaCliente", "start", "new");
                It inserts the data, if it off if it works, it worked well before.
                In order to have some patience

                Comment


                • #9
                  not working onApplicationInit:
                  sc_apl_conf ("app_clients", "start", "new");

                  it was working before the last update

                  can someone help me?

                  Comment


                  • #10
                    Originally posted by calleros View Post
                    can someone help me?
                    Yes, please start a new thread with that ...
                    Best regards: - Reinhard -

                    I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

                    Comment

                    Working...
                    X