LOV with 3 record groups

I have two LOV s one in the mainform and one in the subform. If I select one category from the list in the mainform LOV. In the subform LOV has to change it's record group (3 record groups) depending on the category selected in the mainform LOV. Please help. I am pasting the code I wrote. I tried it in the NEW ITEM INSTANCE TRIGGER, NEW BLOCK INSTANCE TRIGGER (datablock for the 2nd LOV with 3 record groups) and in the NEW FORM INSTANCE TRIGGER. Please help. Thank you.
DECLARE
lov_id1 LOV;
     --val          boolean;
          rg_id1 RECORDGROUP;
     rg_id2 RECORDGROUP;
          rg_id3 RECORDGROUP;
BEGIN
lov_id1 := FIND_LOV ('ACTIVITYTYPE_LOV');
     rg_id1 := FIND_GROUP('ACTIVITYTYPE_RG1');
     rg_id2 := FIND_GROUP('ACTIVITYTYPE_RG2');
     rg_id3 := FIND_GROUP('ACTIVITYTYPE_RG3');
--     val := SHOW_LOV(lov_id1, 32, 48);
IF
     GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1' AND :YOUTH_GOALS.GOAL_TYPE = 'EXIT COUNSELING'
     THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id1');
     ELSIF
     GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1' AND :YOUTH_GOALS.GOAL_TYPE = 'COMPLETE TRAINING'
     THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id1');
          ELSIF
     GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1' AND :YOUTH_GOALS.GOAL_TYPE = 'VOCATIONAL TRAINING'
     THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
          ELSIF
     :YOUTH_GOALS.GOAL_TYPE = 'GRADUATE FROM HIGH SCHOOL'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
     THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
          ELSIF
     :YOUTH_GOALS.GOAL_TYPE = 'IMPROVE ACADEMIC PERFORMANCE'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
     THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
          ELSIF
     :YOUTH_GOALS.GOAL_TYPE = 'OBTAIN GED'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
     THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id2');
          ELSIF
     :YOUTH_GOALS.GOAL_TYPE = 'NON-ACADEMIC'AND GET_LOV_PROPERTY(lov_id1,GROUP_NAME ) = 'rg_id1'
     THEN SET_LOV_PROPERTY(lov_id1,GROUP_NAME,'rg_id3');
     END IF;
end;

try on when-validate-item or on POST-CHANGE
Regards,
Danish Hayder

Similar Messages

  • One LOV multiple Record Groups

    Hi all
    I have 2 text items text A and Text B
    on text A i have a list with two items Say 'cricket' and 'football'
    I have two record groups 'Cricket' and 'football'
    If i select 'cricket' from text A then the LOV for text B should have the 'Cricket' record group attached
    and if i select 'football' from text A then the LOV for text B should have the football record Group attached
    Please tell me how to do it
    Thanks in advance

    Hi,
    why don't you just create two LOV's and exchange them on the fly?
    WHEN-VALIDATE-ITEM Trigger on "A" :
    IF( :A = 'cricket' )
    THEN
    set_item_property( 'B', LOV_NAME, 'Cricket' );
    ELSIF( :A = 'football' )
    THEN
    set_item_property( 'B', LOV_NAME, 'Football' );
    ELSE
    set_item_property( 'B', LOV_NAME, NULL );
    END IF;
    Another possibility would be to create a KEY-LISTVAL Trigger on "B" use "show_lov" to switch between both LOV's.
    Regards
    Markus

  • Strange Problem in dynamically list population with record group

    Hello Room,
    I am dynamically populating a single list with 2 record groups. I am having a strange problem. All the code are written in 2 seperate buttons. The code of every button is given below.
    Button 1 code:-
    DECLARE
    rg_reports RECORDGROUP;
    rg_name VARCHAR2(40) := 'REPORTS';
    vTemp NUMBER;
    BEGIN
    -- Pls make sure Group doesn't already exist
    rg_reports := FIND_GROUP(rg_name);
    -- If it doesn't exist then create it and add ur query to it
    IF Id_Null (rg_reports) THEN
    rg_reports:=CREATE_GROUP_FROM_QUERY(rg_name , 'SELECT companyname,to_char(co) from companymaster order by companyname');
    end if;
    --Populate the Record Group
    vTemp:=POPULATE_GROUP(rg_reports);
    POPULATE_LIST('REPORTS.EXAMPLELIST', rg_name);
    Delete_Group( rg_reports );
    END;
    Button 2 Code:-
    DECLARE
    rg_reports RECORDGROUP;
    rg_name VARCHAR2(40) := 'REPORTS';
    vTemp NUMBER;
    BEGIN
    -- Pls make sure Group doesn't already exist
    rg_reports := FIND_GROUP(rg_name);
    -- If it doesn't exist then create it and add ur query to it
    IF Id_Null (rg_reports) THEN
    rg_reports:=CREATE_GROUP_FROM_QUERY(rg_name , 'SELECT accountname,to_char(co) from accountmaster order by accountname');
    end if;
    --Populate the Record Group
    vTemp:=POPULATE_GROUP(rg_reports);
    POPULATE_LIST('REPORTS.EXAMPLELIST', rg_name);
    Delete_Group( rg_reports );
    END;
    The code is same here only the sql is different in these 2 buttons. Now the problem point.
    when i press button 1, I get the list populated ok. when i try to click on the list item and keep the button pressed the list gets scrolled properly.
    when i press button 2 after that i get account names well populated in the same list item as well, but this time, when i keep the button pressed the list does not scroll below as in button 1. It does not even allow to select different item from the list of button 2 code.
    I tried to clear cache, cookies, exit browser everything and try to run the button 2 first, but still the problem in button 2 code.
    Following are my system details.
    windows 7 professional edition.
    Oracle database 11g on windows 7
    Oracle forms 10g patchset 10.1.2.0.2 on windows 7
    Browser Netscape Navigator with oracle jinitiator 1.3.1.22
    But this form is run by a client side html file where oracle forms 10g is not installed on windows xp. html file is just referring server url to run the module. The file is run on Netscape navigator browser with oracle jinitiator 1.3.1.22
    My question is that is this a bug ? if button 1 gets the list item scrolled, why is the problem with button 2 even though i press it first. Here I am deleting the record group also. after the code is over. Initially I thought this may be the character length problem so I took the maximum character length for that list item as given by the 2 columns in database.
    Why is the list scrolling not happening in button 2 but in button 1 with same codes on both ?
    Anybody please help me.

    The problem is the second query. I would guess that the TO_CHAR(co) is not unique for each account, but is the same for the accounts. And as the second item in the select-list is the listitems values, all your listitem-entries have the same value. therefore, of you select any entry, the list will always go the the first entry again.
    Adjust your query.

  • Dropdown from record group?

    I am new to oracle, i need to have dropdown value list from a database, i know LOV, but it does not support dropdown so i need some way from LOV or from Record group.
    Please if anybody guide me that how can i make a dropdown linst using LOV or Record Group.
    I am using 10g forms.
    Kind Regards
    Naveed

    You can populate list item (if you mean list item) using record group.
    Example: you can use create_group_from_query and populate_group built-ins to get the values from database into record group.
    Then you can use populate_list to populate list item.
    Also, have a look at Oracle Forms help for more information and examples on built-ins.
    regards
    Srinidhi Rao

  • SetID not found for name='BUSINESS_UNIT', value='' with record 'BI_DISC_SUR

    Hi
    While entering identifier in Discount/Sub charge page it giving following error:
    SetID not found for name='BUSINESS_UNIT', value='' with record 'BI_DISC_SUR', tree ''. (2,214) FUNCLIB_CA.RENEWAL.FieldFormula Name:SelectDiscountSurcharge PCPC:12887 Statement:186
    Called from:CA_RNW_CYCLE_PNG.GBL.CA_RNW_LN_REDUC.DISC_SUR_ID.FieldChange Statement:9
    The PeopleCode built-in function GetSetID has been called with parameters that were
    not found in the table set definitions.
    Review the table set control tables and the PeopleCode and correct whichever is wrong.
    Please help me to solve this issue.
    Thanks
    Mani

    did you check if your business unit (setcontrolvalue) is setup with record group BI_04, and it has a default setid associated.

  • Creation of Record Group and LOV at run time

    Hello All,
    I have been stuck by this...I have two text items on which LOVs have been placed.Selection of one depends on selection of other.I can dynamically create a record group but how to create a LOV dynamically to populate it with the dynamic record group been created.
    For more visualization consider that filtering of data takes place in one lOV based on the other LOV been provided.
    Revert ASAP...
    Thanks and Regards,
    Kapil Uppal

    I don't think you can create a LOV dynamically, but you can repopulate a pre-existing one, which should allow you to achieve the same goal.

  • (urgent) Dynamic record groups and LOV

    I have to create a record group and then add 2 rows to it manually.Following is the code.There are no values displayed in the lov.Please help.
    PROCEDURE create_record_group IS
    BEGIN
    DECLARE
    rg varchar2(40) := 'test_fips';
    rg_id RECORDGROUP;
    lov_id Lov;
    err NUMBER;
    gc_id1 GROUPCOLUMN;
    gc_id2 GROUPCOLUMN;
    counter number;
    BEGIN
    rg_id := FIND_GROUP(rg);
    lov_id := FIND_LOV('LOV_FIPS');
    IF NOT ID_NULL(rg_id) THEN
    DELETE_GROUP(rg_id);
    END IF;
    IF ID_NULL(rg_id) THEN
    rg_id := CREATE_GROUP(rg);
    gc_id1 := add_group_column (rg_id,'col1',number_column);
    gc_id2 := add_group_column(rg_id,'col2',char_column,40);
    END IF;
    /* adding static content to LOV */
    ADD_GROUP_ROW( rg_id,1);
    SET_GROUP_NUMBER_CELL(gc_id1,1,997);
    SET_GROUP_CHAR_CELL(gc_id2,1,'MLAB');
    counter := get_group_row_count(rg_id);
    /* adding dynamic content */
    FOR rec in (SELECT FIPS_CD COL1, LOCNAME COL2 FROM FIPS) LOOP
    counter := counter +1 ;
    ADD_GROUP_ROW( rg_id, counter);
    SET_GROUP_NUMBER_CELL(gc_id1,counter,rec.col1);
    SET_GROUP_CHAR_CELL(gc_id2,counter,rec.col2);
    END LOOP;
    SET_LOV_PROPERTY('LOV_FIPS',GROUP_NAME, rg);
    END;
    END;

    I tried creating the group the way you suggested but it does not seem to work because of 'UNION' in the query.It says unable to create rcord group.Did you anytime use the 'UNION' option while creating record group.
    While creating record group at design time also you cannot use UNION with dual.
    This how I modified :
    PROCEDURE create_record_group IS
    BEGIN
    DECLARE
    V_RG_ID RECORDGROUP;
    RG_NAME VARCHAR2(20) := 'TEST_FIPS';
    V_ERRCODE NUMBER;
    BEGIN
    V_RG_ID := FIND_GROUP('TEST_FIPS');
    IF ID_NULL(V_RG_ID) THEN
    V_RG_ID := CREATE_GROUP_FROM_QUERY('TEST_FIPS', 'SELECT FIPS_CD, LOCNAME FROM FIPS
    UNION SELECT 997,'MLAB' FROM DUAL');
    END IF;
    V_ERRCODE := POPULATE_GROUP(V_RG_ID);
    MESSAGE('CREATED '|| V_ERRCODE);
    SET_LOV_PROPERTY('LOV_FIPS',GROUP_NAME, RG_NAME);
    END;
    END;
    Notice here 'MLAB' is char and I get compilation error if I use these quotes with MLAB.But is I remove the quotes the it compiles.
    Thanks

  • Dynamically  populate  a  record  group  on  the  fly uisng LOV

    Hi,
    I want to create dynamically populate a record group on the fly uisng LOV.
    1. This is how the RG_BANKNAME Record Group object look like
    Object : Record Group
    Name : RG_BANKNAME
    Record Group Query : SELECT NAME, SHORT_NAME FROM C_BANKS
    2. I create the Push Button and when user click it will popup the LOV.
    DECLARE
         rg_id RecordGroup;
         errcode NUMBER;
         status BOOLEAN;
    BEGIN
         rg_id := Find_Group('RG_BANKNAME');
         IF Id_Null(rg_id) THEN
              Message('No such group: ',ACKNOWLEDGE);
              RAISE Form_Trigger_Failure;
         ELSE
              errcode :=POPULATE_GROUP(rg_id);     
              SET_LOV_PROPERTY('LV_NAME', TITLE, 'My Own LOV');
              SET_LOV_PROPERTY('LV_NAME', GROUP_NAME, rg_id);
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Title, 'NAME');
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Width, 150);     
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Title, 'SHORT NAME');
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Width, 100);     
              status := Show_LOV('LV_NAME',10,20);
              IF NOT status THEN
                   Message('You have not selected a value.');
                   Bell;
              END IF;
         END IF;
    END;
    My question is do I need to create the LOV Object name call 'LV_NAME'? since I don't have this
    create on my design times, because I thought it can be done dynamically on the fly.
    The problem is compliant that the Lov Id is not valid.
    Thanks
    David
    Edited by: user445990 on May 24, 2011 9:19 PM

    Hello,
    You request is not clear. Do you need to display the LOV or not ? In other words, what is the goal of your record group ?
    Francois

  • Info record with materal group

    dear all?
    i created inforecord with material group with out / material,
    whille iam creating po for one of the material of that material group by entering cost center/ g/l account ,
    there is no net price in iteam and whille i enter the required plant it will showing the error message the material not mainted in the plant.
       pls explan. where i got wrong
               regadrds
    ramakrishna.

    Hi,
    As I know info record w/o material number cannot be applied to a material even if the material groups (material group of the info record and material group of the material) are the same.
    Info record without material number can be applied only to text items in your purchase order (ourchasing documents).
    Regards,
    Csaba

  • Record Group functions - Problerms with a function Get_Group_Selection

    Anywone knows how to delete a record from a record group, i have this code below on the trigger KEY-DELREC, every time i delete a record this code is execute. The problem here is that i whant to delete a row in a record group but , i can't use the function Get_Group_Selection, to find the number of the row i want to delete, when i use the function Get_Group_Selection, it gives me the error FRM-41087 .
    Can aywone help me with that , it's urgent!!
    Thanks
    DECLARE
    ora_err NUMBER;
    rg_id RECORDGROUP;
    the_Rowcount NUMBER;
    gc_id1 GroupColumn;
    gc_id2 GroupColumn;
    v_art_grp_no number(3);
    v_descr VARCHAR2(20);
    v_art_grp_no2 number(3);
    v_descr2 VARCHAR2(20);
    v_ctn NUMBER := 0;
    v_row NUMBER;
    begin
    rg_id := Find_Group('REG_REPAIRS_COMPONENTS');
    the_Rowcount := Get_Group_Row_Count( rg_id );
    --** Make sure the column name specified exists in the ** record Group. */
    gc_id1 := Find_Column('REG_REPAIRS_COMPONENTS.ART_GRP_NO');
    gc_id2 := Find_Column('REG_REPAIRS_COMPONENTS.DESCR');
    FOR j IN 1..the_Rowcount LOOP
         v_ctn := Get_Group_Selection(rg_id,j);
         v_art_grp_no := Get_Group_Number_Cell(gc_id1,v_ctn);
    v_descr := GET_GROUP_CHAR_CELL(gc_id2,     v_ctn );
    if UPPER(v_descr) = UPPER(:system.cursor_value) and UPPER(v_art_grp_no) = UPPER(:repairs_components.art_grp_no) then
         Delete_Group_Row('REG_REPAIRS_COMPONENT',      v_ctn);
         delete_record;
         end if;
         END LOOP;
    end;

    Thanks for the HELP!
    But now i have an other problem that is when i invoke the when-validate item trigger it searchs the field for a value that´s is equal to value in a record group and if it finds it, it raises
    raise_form_trigger_failure and displays a messagem, it works fine but if a press the button save or back it displays the message and after if i press the default button to delete again it doesn´t work .

  • Lov & record group problem

    Hi
    I have to achieve this task.
    I have "company_list" record group and "company_list" lov
    I am form layout style. I am in Enter-query. Then give some value to any field. Then Click execute-query. Its retreiving some records.
    Now if I click the LOV can I show only those records currently I have retreived.
    I have following trigger on button pressed.
    It is giving 1)error Populating group.2)cannot create group company_list 3) error_populating group.
    Anybody pl help me.
    Christy.
    DECLARE
    cur_blk VARCHAR2(40) := :System.Cursor_Block;
    last_qry varchar2(2000);
    bk_id Block;
    rg_name VARCHAR2(40) := 'COMPANY_LIST';
    rg_id RecordGroup;
    errcode number;
    BEGIN
    bk_id := Find_Block(cur_blk);
    last_qry := Get_Block_Property( bk_id, LAST_QUERY);
    rg_id := Find_Group('COMPANY_LIST');
    IF NOT Id_Null(rg_id) THEN
    DELETE_GROUP(rg_id);
    END IF;
    rg_id := Create_Group(rg_name);
    errcode:=Populate_Group_With_Query(rg_id,last_qry);
    end;

    I think that you have to use Create_Group_From_Query() instead of Create_Group():
    rg_id := Create_Group_From_Query(rg_name);
    Helena
    null

  • Static record group and lov problem

    hi all,
    1)I created a form module
    2)created a basic datablock based on empno and ename from emp table.
    3) created a static record group ,where i specified the column name as col1,provided the values as 1 ,2,3,4,5 etc
    4) created an LOV and assigned the above record group to the LOV
    5) then assigned the lov to the emp.empno item in the datablock emp....
    when i run the form .....i get the list of values message on the console (bottom end of the window) ....
    but I am not able to see the LOV when i press the cntrl L or see it from the edit menu command ?
    what must be the problem ?
    ta
    s

    Dear,
    May be you don't set LOV's "Column Mapping Properties". After setting the properties correctly you will be able to display LOV.
    Thanks.

  • Record groups and LOV

    HI
    I have a question regarding LOV's.
    I have 2 fields dept_code which is a checkbox and field2 which is an LOV displaying the employee names based on the dept_code selected.
    My record group has a query like this -
    SELECT empname FROM emp WHERE dept_code IN(:parameter.P_dept_code). p_dept_code is char.
    If the user enters multiple department codes then my p_dept_code should contain commas and single quotes for each department like this ('m10','m20')
    In which trigger do I do this coding and how do I do it?
    Thanks.

    Hi
    Thanks for your response.
    The key-listval does'nt seem to firing.
    When I run the form the lov comes up but displays the value 2 which is from the default record group(select 1 "dno", 2 "ename" from dual).
    This is the code in my key-listval -
    DECLARE
    rg_name VARCHAR2(40) := 'name_rg';
    rg_id RecordGroup;
    gc_id GroupColumn;
    errcode NUMBER;
    BEGIN
    rg_id := Find_Group(rg_name);
    IF Id_Null(rg_id) THEN
    rg_id := Create_Group(rg_name);
    gc_id := Add_Group_Column(rg_id, 'dno',
    CHAR_COLUMN,10);
    gc_id := Add_Group_Column(rg_id, 'empno',
    CHAR_COLUMN,100);
    END IF;
         :parameter.p_dno := ''''||replace(:parameter.p_dno,',',''',''')||'''';
    errcode := Populate_Group_With_Query( rg_id,
    'select dno dno, ename ename from emp1 where dno in ('|| :parameter.p_dno|| ')' );
    set_lov_property('name_lov', GROUP_NAME, rg_name);
    list_values;
    message(errcode);
    END;
    Please let me know what I'm doing wrong
    TIA

  • Help with record selection/grouping

    I am trying to create a report as follows, but am running into some problems with my selection/grouping:
    Data Structure (each line is a separate record; each employee has 2 records)
    Employee             TaskID      TaskStatus           Marker         Date Modified
    1                               A                CLOSED             x
    1                               B                OPEN                  N/A
    2                               A                CLOSED              y
    2                               B                OPEN                 N/A
    3                               A                CLOSED             x
    3                               B                CLOSED            N/A
    4                               A                CLOSED             y
    4                               B                CLOSED           N/A
    Report Requirements
    I want a report that displays only employee number and the date that Task B was completed for all employees, and I want these records grouped based on Task B's Task Status (no problem.  I did this).
    However, I want to sub-group these Task B records (within Task Status) by the Marker field for Task A records!  (I can't figure this out?  If I only pull in Task B records, how can I compare what the associated employee has as a marker for their Task A record?)
    Again, I only want to display data from the employee's Task B record, while subgrouping on a field value from the empoyee's Task A record.  The report would be structured as follows:
    Task B (OPEN), with Task A - Marker (x)
                     {Date Modified}
    Task B (OPEN), with Task A - Marker (y)
                     {Date Modified}
    Task B (CLOSED), with Task A - Marker (x)
                    {Date Modified}
    Task B (CLOSED), with Task A - Marker (y)
                      {Date Modified}
    Thanks.
    Gary

    The easiest way would be to use an SQL Command that returns both the Task A and Task B data on one record.  Something like (MS SQL):
    select b.employee, b.taskid as task_b, b.task_status_b, b.marker as marker_b, b.date_modified as date_modified_b,
        a.taskid as task_a, a.task_status_a, a.marker as marker_a, a.date_modified as date_modified_a
    from table a, table b
    where a.employee = b.employee
    and a.taskid = 'A'
    and b.taskid = 'B'
    HTH,
    Carl

  • Populating list item with a record group

    I'm trying to populate a list item (TList) with a Record group with a simple query: SELECT FRM_NAME FROM FORM
    In the forms WHEN_VALIDATE_NEW_FORM trigger, I use POPULATE_LIST('FORM_LIST', 'RG_FORM_LIST');
    Am I missing something? I get the error FRM-41334: Invalid record group for list population.

    thanks, i've tried that, but still nothing. I must be doing something simple, but very wrong. I tried with oracle's default scott/tiger schema, created a simple form with a record group with 2 columns, and populating a manually made poplist (populate_list('LIST4', 'RG1'); Still get errors:
    FRM-30191: No list items defined for required poplist.
    List LIST4
    Item: LIST4
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.

Maybe you are looking for

  • Sync cable for Zire21

    I recently moved and somehow, the sync cable for my Zire disappeared.  anyone know how i might get another. Post relates to: Zire 21

  • BI Content Browser - Infocube 0BCTCBC01 obsolete?

    Hi, I wanted to get an overview of object relationships with BI Content Browser. In the BI Content documentation, there is an infocube for this 0BCTCBC01. However, when I try to activate this, the following description is written for the InfoCube : "

  • CFINSERT - MSSQL - Russian Characters

    Hello- Need your help in resolving a ColdFusion MSSQL task. I am building an application using ColdFusion MX to support Russian users (Cryleric language). 1. Using cfform, the user can type their data, submit it online and can see their posted data o

  • Bluetooth icon with two rays, what this means?

    My bluetooth stops working from time to time on my MB (unibody late 2008), anyway just restarting the MB solves it. Now I'm trying to find why, because restarting is not an option for me. So my question is: I noticed that wen this happened, the bluet

  • Media encoder or flash problem?

    I'm using the .flv playback component in flash and when I preview my movie in flash it plays all the way through, but when I view through a web browser the movie quits after 25 seconds (it's 30 seconds long). At 25 seconds in, the movie freezes (like