Re: trouble with get_parameter_attr when passing parameters to new form

From: Joe Brown <joe_at_hopi.dtcc.edu>
Date: 21 Oct 1998 02:21:11 GMT
Message-ID: <70jgen$lf1$1_at_apache.dtcc.edu>


Cute...

What you did makes sense, however, it has nothing to do with the way forms actually works.

I don't know why a parameter lists actually need to be named, but they do. As best I can guess it's just a tag... The recieving form has no clue as to the name of the parameter list.

Instead, in form 2 you need to setup parameters using the "Object navigator" find the parameter section.

Add an item called filename, and set it's properties to varchar2, and a length you deem appropriate.

In code, you'll reference this parameter as :parameter.filename

I often setup parameters as form variables. It's better than :Global.whatever because they are local to a given form. Also, you can specify default values. You don't have to pass a value for a specific parameter, but you do have to have one setup before you can pass a value to a parameter.

In article <70j9tf$87j_at_hacgate2.hac.com>, Robert Hoy <hoy_at_solaria.hac.com> wrote:
>Hello to all,
>
>I seem to have a bit of trouble trying to use the function
>get_parameter_attr.
>When I create the parameter list in Form1 and I run into problem in Form2.
>Hopefully, one of you can spot this problem and let me know where I did
>wrong. Thanks for any suggestions.
>
>In the first trigger (of Form1), I want to create a parameter list and here
>is
>what I used:
>
>DECLARE
> pl_name varchar2(20) := 'THEPARAMS';
> pl_id PARAMLIST;
>BEGIN
> pl_id := Get_Parameter_List(pl_name);
> IF NOT Id_Null(pl_id) THEN
> Destroy_Parameter_List(pl_id);
> END IF;
>
> pl_id := Create_Parameter_List(pl_name);
> Add_Parameter(pl_id, 'FILENAME',TEXT_PARAMETER,:operation.filename);
> Open_Form('Form2',activate,session,pl_id);
>END;
>
>
>In Form2, When-New-Form-Instance trigger:
>
>DECLARE
> paramtype number;
> pl_id PARAMLIST;
> pl_name varchar2(20) := 'THEPARAMS';
>BEGIN
> pl_id := Get_Parameter_List(pl_name);
> if id_null(pl_id) then
> :block.parameter := 'None!!!';
> else
> Get_Parameter_Attr(pl_id,'FILENAME',paramtype,:block.parameter);
> end if;
>END;
>
>When I run Form2 by itself, the block.parameter is set to "None!!!" as
>expected.
>When I call Form2 from Form1, then I get the following error:
>
>"FRM-47023. No such parameter named FILENAME exists in form FORM2."
>
>I tested with the Get_Parameter_Attr in the first trigger (of Form1), it
>worked.
>
>
>-Robert
>
>----------------------------------------------------------------------------
>Robert Hoy hoy_at_solaria.hac.com
>----------------------------------------------------------------------------
>"You are erratic, conflicted, disorganized...You lack harmony, cohesion,
>greatness. It will be your undoing." said the arrogant Borg Seven of Nine on
>Star Trek Voyager.
>
>

--
(: Joe Brown :)				      joe_at_apache.dtcc.edu
I believe Wine is going to be great if it ever gets finished. . .
I believe Linux _is_ great even though it's not finished! ! !
I believe you have my address.  :-)
Received on Wed Oct 21 1998 - 04:21:11 CEST

Original text of this message