Frank
Frank

Reputation: 1345

Oracle Forms: How to pass variable between windows by popup menu

I have created a form for a master table, now I want to open another form displaying the details when right click a field and choose "Details".

How could I get the "ITEM ORDER" and pass the value to the new form to show the related information ? If it's not stated clearly, please comment. Thanks

Example picture

Upvotes: 1

Views: 8503

Answers (1)

Vlisisids Akis
Vlisisids Akis

Reputation: 81

One of the parameters of call_form or open_form procedure is a parameter list. You use this parameter list to pass parameters. On the calling form:

  1. create a parameter list

  2. add the parameter to the param

  3. call_form using this parameter list:

DECLARE
    fParams ParamList := null;
BEGIN 
  fParams := Get_Parameter_List('SOME_NAME'); 
  IF (not Id_Null(fParams)) THEN 
    destroy_parameter_list(fList);
  END IF;

  fParams := Create_Parameter_List('SOME_NAME');
  Add_Parameter(fParams, 'PARAM_NAME', TEXT_PARAMETER, 'PARAM_VALUE'); 
  OPEN_FORM('Form_Name', ACTIVATE, SESSION, NO_SHARE_LIBRARY_DATA, fParams);
END;

On the Called Form: You must declare the parameter on the Parameters section, with the same name as the one used in add_parameter. After that you can reference the parameter by using :parameter.param_name.

One word of caution: You can not use :parameter in the where clause of data blocks. Copy the parameter to another data block item and use this one.

Upvotes: 2

Related Questions