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:
[glob_activityseq]={activityseq}

in the button event:

sc_redir(nd_freeform, glob_activityseq=[glob_activityseq]);

how odd is that?

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.

jsb

You solved this problem Albert?