pass a link to next page

Hi,

I have a page on which there is a table.
In this table there is a reference number. This reference number is a link which leads to an excisting page.

Now what I want to do is after I click on the link, the (actual) username and reference number must somehow be passed through to that page so the page can automatically be filled.



Here's a piece of code:

FIND table where table.rcode = tabeldeta.rcoderef no-lock.


{&OUT} "</tr>"
"<tr>"
"<td> <a href='searchrefdetails.html?rcode#="
table.rcode "&rusername#=" table.rusername "'> " table.rcode " </td>"
"<td> " table.ddate " </td>"
"<td> " tableprod.nvoice " </td>"
"<td> " tablelist.nvalu " </td>"
"</tr>"
"<tr>"
"<td> " "</td>"
"<td> " table.nname " </td>"
"</tr>".

This code is in file called overviewrefdetails.html.
After clicking on the link, it must go to searchrefdetails.html en with the rcode and rusername it must fill in some other basic forms which are to be found in searchrefdetails.html.

Any ideas on how to do this?

Many thanks!
 

jongpau

Member
Have you tried using GET-VALUE(<field name>) in the page that is opened?

So
cUserName = GET-VALUE("rusername#")

cRCode = GET-VALUE("rcode#")

Also, if I were you I would use URL-ENCODE when you put the values in the query string, so:

"<td> <a href='searchrefdetails.html?rcode#=" URL-ENCODE(table.rcode)
"&rusername#=" URL-ENCODE(table.rusername )"'> " HTML-ENCODE(table.rcode) " </td>"

(the above assumes that both fields are character fields). Using URL-ENCODE ensures that any special characters (such as " ", & and ?) are translated to their correct query string values.

Note that I also popped in a HTML-ENCODE for displaying data in the html page (which does a similar thing to URL-ENCODE, but translates the HTML special characters)

HTH
 
jongpau said:
Have you tried using GET-VALUE(<field name>) in the page that is opened?

So
cUserName = GET-VALUE("rusername#")

cRCode = GET-VALUE("rcode#")

Also, if I were you I would use URL-ENCODE when you put the values in the query string, so:

"<td> <a href='searchrefdetails.html?rcode#=" URL-ENCODE(table.rcode)
"&rusername#=" URL-ENCODE(table.rusername )"'> " HTML-ENCODE(table.rcode) " </td>"

(the above assumes that both fields are character fields). Using URL-ENCODE ensures that any special characters (such as " ", & and ?) are translated to their correct query string values.

Note that I also popped in a HTML-ENCODE for displaying data in the html page (which does a similar thing to URL-ENCODE, but translates the HTML special characters)

HTH

I get the following error: mismatched number of parameters supplied to 'url-encode' expecting 2 but 1 were specified

Also what do you mean with these 2 vaiables:

cUserName = GET-VALUE("rusername#")

cRCode = GET-VALUE("rcode#")?

Must I locally define them in searchcalldetails?
 
Hi,

I found the solution.
I use 2 defined functies called getVal and setVal. This is ofcourse OK when I pass data through other pages when the data isn't changing.
This worked for the other pages but there is a page which has to use data which changes quite often.

Solution is to set a userfield when you know you have the right data and in the calling page define a hidden input field so that the page can get to it.

Cao :)
 
Top