Announcement

Collapse
No announcement yet.

Grid Run button: onRecord never executes

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

  • Grid Run button: onRecord never executes

    A simple Grid application.
    A Run Button, "Check The Count".

    onScriptInit:
    [i] = 0;
    [arr] = array();

    onRecord PHP:
    $ind = [i];
    [arr][$ind] = {_id};
    [i]++;

    onFinish PHP:
    $tot = [i];
    echo "The value of i is $tot";

    Check a bunch of items, click the button, and the result is always:
    "The value of i is 0"

    It's very strange that onFinish executes, but onRecord does not.

  • #2
    onFinish PHP:
    $tot = implode(",", [arr]));
    echo "The value of arr is " . $tot;

    // reset
    [i] = 0;
    [arr] = array();
    Best regards: - Reinhard -

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

    Comment


    • #3
      Originally posted by RHS View Post
      onFinish PHP:
      $tot = implode(",", [arr]));
      echo "The value of arr is " . $tot;

      // reset
      [i] = 0;
      [arr] = array();

      That results in $tot == '' - an empty string.

      Yes, I have reset logic. The point is that onRecord never executes. [i] is always 0, and [arr] is always empty.

      Update: I exported / deleted / imported the Grid application. It made no difference.
      Last edited by Giblet535; 06-04-2014, 11:26 AM. Reason: Update

      Comment


      • #4
        Perhaps in Grid / Application / Global Variable the var type is wrong?
        Best regards: - Reinhard -

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

        Comment


        • #5
          The vars are set as SESSION / out.

          Application->Global Variables shows them defined in Events(onInit) which is onScriptInit, and used in Buttons(Check onRecord)


          Edit: Even though the above should work, ScriptCase docs indicate the correct settings are POST+GET / out.

          http://www.scriptcase.net/samples/tu...rid/grid46.php

          That makes no difference either.
          Last edited by Giblet535; 06-04-2014, 12:06 PM.

          Comment


          • #6
            I have a grid with four run buttons, the variables set as POST+GET and OUT. This works without problems ...

            Can you export your app and upload it (dropbox or ...)?
            Best regards: - Reinhard -

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

            Comment


            • #7
              Too much sensitive code to upload the one I'm testing with.

              I'll try creating a basic grid app, duplicate (or not?) the problem, and upload that later today.

              I appreciate your help. I suspect this is just some kind of odd corruption...

              Comment


              • #8
                Try it this way.
                onScriptInit:
                [arr] = array();

                onRecord PHP:
                [arr][] = {_id};

                onFinish PHP:
                $tot = count([arr]);
                echo "The count is ".$tot;

                jsb

                Comment

                Working...
                X