onRecord create Variable for Post or Get NOT Session?

Is it not possible to create a variable for each record that could be used to build capture links? I don’t want a session variable since the last onrecord overwrites it… I want a variable that is used to build a different Capture Link “Retrieve” for each row.
In regular PHP I could do this by using a local variable that is first output to the page then overwritten each time a new record is displayed.
This seems like a pretty basic function that I can’t figure out how to get working in Scriptcase. Am I missing something obvious here?
Thanks for any help.

I have found a way to almost get what I need.
Here’s what I did.
I created the Capture Link and assigned it my Session Variable. That was working for a Single Record, but not when I did Multiple Records because the Session Variable gets overwritten with the last records data.
So I took the generated code (The HTML Output) and looked at it closely for the Lookup (Magnifying glass or “Retreive” button) and found that the part where it sends the variable is between two tags like this:

&nmgp_parms=getdescscinXXXXXXXscout

Where the X’s are above is where the variables data gets put.
I copied that entire section of code from the opening <A HREF> to the closing </A> and created a new Text field.
Inside that link it also includes the row number so I created a session variable that is set to 0 onLoad then gets incremented by adding 1 onRecord for each row.
I took the field that I needed to use for my lookup and urlencoded() it. then I build the entire string for the lookup button and included my urlencoded variable and the counter variable.
I then sent that to the new field that I created.

Now it works!

The only problem is I have two lookup icons, and only the 2nd one (The one I am creating) does what I want. If I remove the capture link from the form then my generated capture link doesn’t work either.
This may be confusing to read so let me include a few screen shots.

My code:

The Output:

So as you can see it’s working but I don’t know if there is some way for me to hide the first lookup field link without removing the link… or perhaps I can just manually add the code that is missing once I remove the capture link?

Anyone have any ideas?

Also… I still think this is a crazy way to go about doing something that seems so simple. I just need to create multiple capture links based on a field that changes its value for each record. Surely someone else has needed this function before?

Thank you for any help.

Screen Shot 2014-10-02 at 1.20.40 AM.jpg

Screen Shot 2014-10-02 at 1.20.50 AM.jpg

Screen Shot 2014-10-02 at 1.23.16 AM.jpg

Update:

I created another field and then created a capture link on that field, then I hid the field.
Now all I see is my generated Capture link and everything seems to be working correctly!

Screen Shot 2014-10-02 at 10.21.19 AM.jpg

Im not out of the woods yet!
Now it all works when I run it locally, but when I deploy it the “Capture” button I created does NOT show up. I guess its hidden.
anyone have any ideas? This is really frustrating… after finally getting it working, now I can’t deploy!

I was wrong… it was my fault!
I used the generated code from within the dev environment to create the button… I needed to modify that paths to match the production environment.
Scriptcase Rocks!!