Alejandro
|
Posted: 01/19/2004, 2:08 PM |
|
My search parameter isnīt in the URL but I can get it from another form or doing a Dlookup.
How I must configure the grid parameter to use the obtained value to make the search before page show.
|
|
|
peterr
Posts: 5971
|
Posted: 01/19/2004, 2:29 PM |
|
"URL" is only one type of parameters and You can select several others.
Please see: http://docs.codecharge.com/studio/html/UserGuide/Forms/FormDataSource.html http://docs.codecharge.com/studio/html/UserGuide/Forms/FormDataSource.html
("Input parameters can be received from other forms, via the URL, cookies or session variables.")
If you like to use DLookup, try using an Expression type parameter. Or if as you said it is coming from another form then select "Form" instead of "URL".
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
peterr
Posts: 5971
|
Posted: 01/19/2004, 2:29 PM |
|
Sorry, one of the URLs above should be: http://docs.codecharge.com/studio/html/UserGuide/Forms/ug285.png
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
Alejandro
|
Posted: 01/20/2004, 10:49 AM |
|
> If you like to use DLookup, try using an Expression type parameter.
I did it in the following way
function pruebas_usuario_ds_BeforeBuildSelect()
{
$pruebas_usuario_ds_BeforeBuildSelect = true;
global $pruebas_usuario;
// Write your own code here.
global $DBevaluar;
// Adiciona el parametro de busqueda grado
$id_grado = CCDLookUp("grado_id","usuario","usuario_id=".CCGetUserID(),
$DBevaluar);
if ($pruebas_usuario->ds->Where <> "") {
$pruebas_usuario->ds->Where = $pruebas_usuario->ds->Where . " AND ";
}
$pruebas_usuario->ds->Where = $pruebas_usuario->ds->Where . "grado_id ="
.. $id_grado;
// -------------------------
//End Custom Code
It worked fine, but the question is: Is there any way doing the same through
the parameter definition of the grid?
>Or if as you said it is coming from another form then select "Form" instead
of "URL".
If the two forms are to be loaded at the same time, how could I do the same
action?
> _________________
> Peter R.
> YesSoftware Support Representative
> http://support.codecharge.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
Nicole
Posts: 586
|
Posted: 01/26/2004, 5:10 AM |
|
Alejandro,
You can create the WHERE parameter that is based on the code expression (DLookUp() function) right in Data Source dialog. Here is sample parameter settings
Field
Name: grado_id
Type: Integer
Operation: equals(=)
Parameter Source
Name: CCDLookUp("grado_id","usuario","usuario_id=".CCGetUserID(),
$Dbevaluar)
Type: Expression
Default Value: specify it for case no grado_id is looked up
Regards,
Nicole
_________________
Regards,
Nicole |
|
|
|