Making filter when using LOV [message #83867] |
Tue, 23 December 2003 03:44  |
Jamil
Messages: 13 Registered: December 2003
|
Junior Member |
|
|
Dear Friends
How can I make a filter in the field, which has LOV for example if the LOV used for this field Ename , if I type in the Ename S and press F9 I will get only name start with S like SMITH, SCOTT .
Best Regards
Jamil
|
|
|
Re: Making filter when using LOV [message #83882 is a reply to message #83867] |
Wed, 24 December 2003 20:56   |
sameer_am2002
Messages: 129 Registered: September 2002
|
Senior Member |
|
|
You can achieve this functionality with the following.
Create an Lov on a particular field for which you need the functionality.Then in the Key-ListVal trigger of this item write this following code.This i created according to my Schema.
declare
lrRg_Name Varchar2(30) := 'MENU_RG1' ;
lrRg RecordGroup ;
lnErrNo Number;
lvStr Varchar2(3000) ;
lvLov Boolean ;
begin
lrRg := Find_Group(lrRg_Name) ;
If Not Id_Null(lrRg) Then
Delete_Group(lrRg);
End If;
lvStr := 'Select ID , Title from Menu where UPPER(Title) like '||''''||UPPER(:Title)||'%'||'''';
lrRg := Create_Group_From_Query(lrRg_Name , lvStr);
lnErrNo := Populate_Group(lrRg) ;
set_lov_property('MENU_LOV' , group_name , 'MENU_RG1') ;
lvLov := Show_Lov('MENU_LOV') ;
end ;
In this code i'm creating 1 more recordgroup and associating this recordgroup with the Lov which i created during design time.Remember ur recordgroup structure should be same as you created during design time
|
|
|
Re: Making filter when using LOV [message #83890 is a reply to message #83867] |
Sat, 27 December 2003 22:20  |
Jamil
Messages: 13 Registered: December 2003
|
Junior Member |
|
|
Dear Sameer
Thank you very much for your cooperation
I created the trigger Key-listval , on the field that I want to make filter on it, as follow using user your code
declare
lrRg_Name Varchar2(30) := 'BRANCH_LIST' ;
lrRg RecordGroup ;
lnErrNo Number;
lvStr Varchar2(3000) ;
lvLov Boolean ;
begin
lrRg := Find_Group(lrRg_Name) ;
If Not Id_Null(lrRg) Then
Delete_Group(lrRg);
End If;
lvStr := 'Select B_CODE , B_NAME from BRANCH where UPPER(B_NAME) like '||''''||UPPER(:D_BRANCH_CODE)||'%'||'''';
lrRg := Create_Group_From_Query(lrRg_Name , lvStr);
lnErrNo := Populate_Group(lrRg) ;
set_lov_property('BRANCH_LIST' , group_name , 'BRANCH_LIST') ;
lvLov := Show_Lov('BRANCH_LIST') ;
end ;
Notice :
BRANCH_LIST is the LOVS Name and the Record Group Name as well
And this LOV and Group name is already create manually before by using this select statement
SELECT B_CODE,B_NAME
FROM BRANCH
And the column mapping properties of the field BRANCH_LIST mapped the fields as follow :
B_CODE RETURN ITEM to D_BRANCH_CODE AND B_NAME RETURN ITEM
to BRANCH_NAME
when I enter s in the field to D_BRANCH_CODE and press F9 I am getting the following FRM messages :
FRM-41075 ERROR DELETING GROUP
FRM-41072 CANNOT CREATE GROUP BRANCH_LIST
FRM-41076 ERROR POPULATING GROUP
Than you very much for your cooperation, waiting for your valuable replay
Best Regards
Jamil
|
|
|