Dear All,
best wishes...
I am currently doing some additions to existing forms.
actually i am having two forms Form A and From B. Form A based on Table A and Form B based on Table B
Existing Scenario.
Form A -- > Table A contains columns like
A1Col1 -- Primary key
A1Col2 -- Primary key
A1Col3 -- Primary key
A1Col4 -- Primay key
A1Col5
A1Col6
Form B --- > Table B
B1Col1 = A1Col1
B1Col2 = A1Col2
B1Col3 = A1Col3
B1Col4 = B1Col4 ( This is newly added column in TableB and in existing form I dont have this relation, so i
added a text item in Form B and made it database item and set it the coloumn name)
B1Col5
B1Col6
Existing Functionality:
Form A is main form and there is one buttion when pressed it will pass parameters (A1Col1
A1Col2,A1Col3 to Form B based on which form B will query the details.
Existing code for that push button in FormA is :
DECLARE
pl_id ParamList;
pl_name VARCHAR2(15) := 'ls_parm_list';
BEGIN
if :TableA.A1Col1 > ' ' and
:TableA.A1Col2 > ' ' and
:TableA.A1Col3 > ' ' and
:TableA.A1Col4 > ' ' then (-- (newly added line for current requirement)
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,'A1Col1',TEXT_PARAMETER,:TableA.A1Col1);
Add_Parameter(pl_id,'A1Col2',TEXT_PARAMETER,:TableA.A1Col2);
Add_Parameter(pl_id,'A1Col3',TEXT_PARAMETER,:TableA.A1Col4);
Add_Parameter(pl_id,'A1Col4',TEXT_PARAMETER,:TableA.A1Col3); -- (newly added line for current requirement)
Add_Parameter(pl_id,'A1Col5',TEXT_PARAMETER,:PARAMETER.UID);
NEW_FORM('FormB',TO_SAVEPOINT,NO_QUERY_ONLY,pl_id);
end if;
END;
Code for New form instance in FormB:
DECLARE
W_WHERE VARCHAR2(100);
BEGIN
if :PARAMETER.Param1 > ' ' then
W_WHERE := 'B1col1=''' || :PARAMETER.param1 || ''' AND B1col2=''' || :PARAMETER.param3 || ''' AND B1col3 =''' || :PARAMETER.param4 || ''' AND B1col4=''' || :PARAMETER.Param4 || '''';
Set_Block_Property('TableB',DEFAULT_WHERE,W_WHERE);
execute_query;
Set_Block_Property('TableB',DEFAULT_WHERE,'');
end if;
:SYSTEM.MESSAGE_LEVEL := 25;
END;
So Now,
New Functionality:
I need to pass an additonal column in TableA (A1Col4) also a parameter to form B so that it will in the where clause of B form.
To achieve this requirment,
Step1:
Step1: I have added B1Col4 to TableB as it was not there earlier.
Step2: I have added a text item in FormB, named it as "A1Col4" and set its Database iterm property to Yes and columname to A1Col4.
And then I have created a Parameter called "'A1Col4'' in FormB (This iis since i added a new parameter in FormA's when buttion pressed code above)..
Now the actual issue i am facing:
I compiled both the forms and it went fine..I ran the FormA.. Below are the scenarios:
1. FormA is fine running and when i issue query, it executes gets data, when press buttion to go form B (to pass all 4 parameters to formb, I am getting error. FRM 47023 No such parameter named A1col4 exist in FormB. even though i have parameter in form b created newly with this name.
2. so I just kept existing code in when buttion pressed (commented newly lines added,keeping existing 3 parameters instead of 4) and removed ''' AND B1col4=''' || :PARAMETER.Param4 || '''' from whennewform instance code in formb, the result is: FormA calls FormsB successfuly , FormB is being opened BUT VERY STRANGE, THAT NEWLY ADDED ITEM (COLUMN OF TABLEB WHICH I WANTED TO PASS AS ADDITIONAL PARAMETER FROM FORM'A') IS DISAPPEARED. That text item itself not being displayed.
3. If I run FormB alone, then It is querying data, the newly added text item is also being displayed but If if i call the same from FormA, error FRM 47023.
I am sitting hours and hours to find out what exactly the problem..but no clues...
Really sorry for long post..but hoping and seeking for help from our OTN network friends..
Hope I have explained the problem clearly..By the way version is 10G forms.
Thanks for help in advance for everybody...
Regards,
Prasanth