Reputation: 445
I am new to Oracle forms and I am designing writing an application in the same. I have a problem in the following scenario.
I have a form (FORM1) to display a list of items without details for authorization. Before an item is authorized, the authorizer will have to see the details. This calls for another form (FORM2) that will invoked whenever an item has been selected and the button 'VIEW' has been selected. The details will be displayed there. On FORM2 also will be buttons: REJECT,APPROVE and BACK.
Here is FORM1 when-button-pressed event for VIEW button:
DECLARE
list_id ParamList;
USR_MSG NUMBER;
BEGIN
IF :TBL_CONTRACT.CONTRACT_NO IS NULL THEN
USR_MSG:=USER_ALERT('INFO_ALERT','Please select a valid contract no to View.');
RAISE FORM_TRIGGER_FAILURE;
END IF;
list_id := Create_Parameter_List('PAR_CONTRACT');
Add_Parameter(list_id, 'CONTRACT_NO',TEXT_PARAMETER,:TBL_CONTRACT.CONTRACT_NO);
call_Form('T:\FRM_APPROVAL_VIEW.fmx',no_hide,no_replace, no_query_only,list_id);
END;
My intention is to pass contract_id to FORM2 and query the database for details which will then be displayed on the form.
Here is the code for Form2 when-new-form-instance event.
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WINDOW_STATE,MAXIMIZE);
BEGIN
IF ( :PARAMETER.PAR_CONTRACT IS NOT NULL ) THEN
/* Use this value in the WHERE clause of MY_BLOCK */
Set_Block_Property('TBL_CONTRACT',DEFAULT_WHERE, 'PAR_CONTRACT = :PARAMETER.PAR_CONTRACT');
GO_BLOCK('TBL_CONTRACT');
Execute_Query;
END IF;
END;
When I run the application I run into error: FRM 47023, No such parameter named Contract_No exists in form FRM_APPROVAL_VIEW.
Would some one explain what is wrong and the remedy.
Thanks in advance.
Upvotes: 2
Views: 11372
Reputation: 1319
The name of the forms parameter in the child form should be the name of the parameter (CONTRACT_NO) and not the name of the parameter list! If you rename the forms parameter and change the code to use :PARAMETER.CONTRACT_NO then this should work for you.
Upvotes: 1