No announcement yet.

[SOLVED] Set Global Variable or Session Variable from button

  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] Set Global Variable or Session Variable from button

    I am getting back into SC after a few years away from it.
    Man did I know a lot more then than I do now.

    I have a form that has 4 buttons on it. They actually run the same grid, but I want to set a global or session variable when I click the button, so later in my scriptinit code of my grid I can adjust the "where" clause.

    Can I do that, or if so, how?

    It's probably something simple but it escapes me on how to do it at this point.

  • #2
    Sort of got it going but still having one issue.
    On the button which I have setup as php I put this code.
    $_SESSION['parm1'] = "closest";

    Then I can check this in my grid. That works, but when I go to my grid I get a blank screen that has a button that says "OK".
    This didn't come from me, so I need to find a way to get rid of that.

    Any ideas?


    • #3
      I advise you to use the standard SC way of using [global var]. You can declare them as session variable. To avoid the ok button you need to apply a sc_redir macro. Be aware that if you have pending updates you need to commit the update manually or the update will get lost.
      Albert Drent
      aducom software netherlands
      scriptcase partner, reseller, support and (turn-key) development /


      • #4
        Thanks, that worked.