Amazon

How to pass parameters from one form to another form in oracle forms?

You can easily pass parameters from one form to another form by using this code. we need to transfer values of parent form to child form for different purposes for example for Login name ect….
1- Make one parent form in oracle forms builder
2- Write this code behind the button of parent form that will transfer parameters to child form.
  • Child form Name and location :       D:\SUB_CAT_SIZES.FMX
  • Child form parameter name:             P_SUB_CAT_ID (Destination parameter)
  • Parent form parameter name:        :SUB_CAT_ID (Source parameter)

————————————————-
DECLARE
temp_id paramlist;
RPT_NAME VARCHAR2(30);
BEGIN
temp_id := CREATE_PARAMETER_LIST(‘V_A’);
ADD_PARAMETER(temp_id,’P_SUB_CAT_ID’,text_parameter,:SUB_CAT_ID);
CALL_FORM(‘D:\SUB_CAT_SIZES.FMX’,NO_HIDE,DO_REPLACE,NO_QUERY_ONLY,TEMP_ID);
destroy_parameter_list(temp_id);
END;
———————————————
3- when you will press button then parameter data will transfer into child form and also call child form.

Using personalization :- 

Forms Personalization: Launch a Function
Knowing what to put in the parameter field is where I got a little lost. I needed to pass through multiple NAMED parameters consisting of information from the form itself (block.item) and SQL Statements. For example:
PARAM1=<value1> PARAM2=<value2>
Where:
value1 is a field on the current form I was personalizing
value2 is the result of a SQL statement
The documentation for Forms Personalization did not really have too much meat as to how to do this, so through some trial and error, the documentation, some forum postings and a My Oracle Support note (429604.1)… I found the following to be true.
1. You can pass form field values as named parameters using the following syntax:
‘PARAM1=’ || ${item.<block>.<item>.value} || ‘ PARAM2=’ || ${item.<block>.<item>.value}
2. Additionally, you can pass form field values as named parameters using the following syntax:
=’PARAM1=’ || :block.item || ‘ PARAM2=’ || :block.item
3. You can pass the value returned from a select statement as a named parameter using the following syntax:
=select ‘PARAM1=’ || <column> A from <table> where <x> = <:block.item>
4. And finally you can combine 2 & 3 above to pass both form field values and the result of a SQL statement at the same time using the following syntax:
==select ‘PARAM1=’ || <:block.item> || ‘ PARAM2=’ || <column> A from <table> where x = &lt:block.item>

No comments:

Post a Comment