Stefano Cazzani
|
| Posted: 09/23/2002, 11:59 AM |
|
I would like to add a URL parameter in a After Insert event in CCS. (ASP)
I tried to manipulate the Redirect variable in Custom Code with something like
Redirect = Redirect & "myNewParameter=xxxx"
but apparently CCS rewrites the Redirect variable after the custom After Insert event.
Is there another solution, possibly without using Session variables?
In the old good CC days, we used to manipultae the "sParam" and "sActionFileName" variables, what is their equivalent in CCS?
Many thanks in advance for any help on this.
Stefano
stefano@cazzani.com
Milan, Italy
|
|
|
 |
Brent
|
| Posted: 09/23/2002, 5:02 PM |
|
I don't know if this helps or not, but try removing the Return Page from the form.
If you have a Return Page defined it will override any $Redirect that gets set in
the events called by Operation().
This is probably a design flaw. The $Redirect in Operation() function should be
set to the Return Page value *before* the event is called which will allow the event to override it.
Brent
|
|
|
 |
Nicole
|
| Posted: 09/25/2002, 3:39 AM |
|
Stefano,
if you need to change form's action on the CCS Record form (or Search form) you can do it by creating Button server side onClick event. Just edit Redirect variable value there. E.g.:
Rdirect = "PageName.asp?param_name=" & param_value
|
|
|
 |
Stefano Cazzani
|
| Posted: 09/25/2002, 7:45 AM |
|
Unfortunately, neither of the two methods that Brent and Nicole suggested worked as we hoped.
The problem is that the ASP code automatically generated by CCS rewrites the Redirect variable just after the OnClick and AfterInsert events.
In order to solve the problem, we had to manually alter the code generated by CCS in the Operation Method.
I hope that someone else or YesSoftware will suggest an easier solution. I think this is quite a common need to many people, for instance anyone using Access databases willing to get the Last Inserted ID in a table in a record form and trying to pass it to another page.
Stefano Cazzani (stefano@cazzani.com)
Milano, Italy
|
|
|
 |
Brent
|
| Posted: 09/25/2002, 8:00 AM |
|
>>The problem is that the ASP code automatically generated by CCS rewrites the Redirect
>>variable just after the OnClick and AfterInsert events.
Stefano,
That is part of the design flaw I was talking about. In Operation() it explicitly
sets the $Redirect variable AFTER the event is called even if the event returns True.
Operation() should really preset the $Redirect for True BEFORE calling the event
which gives the event the ability to override it. 
Brent
|
|
|
 |
teufel
|
| Posted: 10/10/2002, 9:51 AM |
|
I believe you might be doing something wrong, since I managed to pass the URL parameter by doing exactly what Nicloe suggested, i.e.:
Inside the On Click server event of my form, where I have custom DELETES and INSERTS. If the SQL operations are performed successfully, then I do the following attribution to $redirect var:
global = $Redirect;
$Redirect = "the_same_page.php?SuccessMessage=Operations%20performed%20with%20success!!!";
And then on the Before Show event for the label 'SuccessMessage' (this label is where the message is to be shown) I coded:
global $SuccessMessage;
$SuccessMessage->SetValue(CCGetParam("SuccessMessage",""));
---
The only question I still have: which test should I make in order to show the message only if it was filled by the OnClick event (thus avoiding users from hacking the URL)?
Thanks,
teufel
|
|
|
 |
|