No announcement yet.

button and fieldvariables

  • Filter
  • Time
  • Show
Clear All
new posts

  • button and fieldvariables

    I have an editable grid-view form with a button. In the button I have the following code:

    sc_redir(nd_freeform, glob_activityseq={activityseq});

    This does not work as the {activityseq} is empty. This is a part of the primary key of the shown record(s), so it does have a value.

    I displayed the value by echo-ing it, but the field is empty. If I put a manual value into the sc_redir, the application works:

    sc_redir(nd_freeform, glob_activityseq=0); // works!

    For me, this is a bug?

    I managed to create a global varable, assign the activityseq to that and use it in the sc_redir:

    in onloadrecord:

    in the button event:

    sc_redir(nd_freeform, glob_activityseq=[glob_activityseq]);

    how odd is that?
    Last edited by aducom; 11-19-2014, 06:44 AM.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development /

  • #2
    Well, it depends. Technically, as soon as you hit the button you are leaving the page (the button code is executed on it's own page while staying in the same window)
    therefore no field names, which are local variables of the form, are available. To circumvent this, move your php code of the button into a php method of the form and
    it will work beautifully.
    If I'm wrong, at least it reads like a good explanation.



    • #3
      You solved this problem Albert?
      Best regards,
      Thomas Soares.
      ScriptCase International.

      Visit our Blog:
      Visit out fan page: