unaprogrammer
Posts: 5
|
Posted: 04/01/2004, 6:13 AM |
|
I have a user who wants to retain values between pages as she enters orders into our Oracle database. We are using PHP. I used the Record Builder. Here is how I did this:
POST and GET
There are two methods to send data from the form to the corresponding php program on the server: GET and POST. GET sends data as arguments in the URL. POST sends data as part of the body of the page.
CCS pages that insert records into a database only work using the POST method. If you specify GET, CCS assumes that the page is just collecting data or just a display page with no database, even if you have specified a connection. It will not insert rows.
However, you can still send and retrieve data using URL args even though the method is set to POST. If you wish to pass field values between form cycles this is a good way to do that.
Method for passing parameters between forms.
SENDING PAGE:
Navigate to the record (JOBS in my case) and use the Events tab on the Properties sheet to create custom code in the After Insert event. Use the plus sign to Add Code. Then insert a line similar to this:
$Redirect = $Redirect."custmrid=".$JOBS->CUSTMRID->GetValue();
$Redirect is the CCS variable for the Return Page. This line adds a parameter to the URL which you can see when you run it.
RECEIVING PAGE:
Navigate to the record (JOBS) and use the Events tab on the properties sheet to create custom code in the Before Show. Use the plus sign to Add Code. Then insert a line similar to this:
$JOBS->CUSTMRID->SetValue(CCGetParam("custmrid"));
CCGetParam will retrieve a value from a URL argument.
Using this will override any default value for custmrid specified in the Properties sheet so you may have to set the default value in CCGetParam like this:
$JOBS->CUSTMRID->SetValue(CCGetParam("custmrid","NYCTA"));
|
|
|
|