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

Similar Messages

  • Dynamically creating a Record Group based on Previously entered Record Grou

    Forms [32 Bit] Version 10.1.2.3.0 (Production)
    Hi,
    I know how to dynamically create a record group based on a query and putting the code in When new form instance.
    My query is. I have a form which has multiple Record Groups and the user wants to dynamically create subsequent groups based on previous groups.
    For example
    I have a record group with selects a Location,
    when the user selects the Location from a list of values
    the 2nd record group called 'Cost Centres' will have to filter out only those with the locations selected above.
    How can I populate the 2nd record group at run-time when I do not know what site the user will select?
    If I simply populate in when new form instance as in location and just select everything, the list of values populates.
    CC field is a LIST ITEM and the list style is a POP LIST, it is not required.
    I have put the code in the Location field in the when-list-changed trigger.
    I am getting this error:
    frm-41337: cannot populate the list from the record group
    here is the code:
    DECLARE
    v_recsql Varchar2(1000); -- The SQL for creating the Record Group.
    v_recgrp RecordGroup; -- Record Group
    v_status Number; -- Return Value of Populate_Group function.
    c_where VARCHAR2(1000);
    BEGIN
         IF :location = '1' THEN
              c_where := ' substr(cost_centre,1,2) in (''01'',''02'')';
         ELSIF :location  = '2' THEN
              c_where := ' substr(cost_centre,1,2) in (''02'',''03'')';
         ELSIF :location   = '3' THEN
              c_where := ' substr(cost_centre,1,2) in (''01'',''11'',''07'')';
                   ELSE
              c_where :=  ' 1=1'; --EVERYTHING
         END IF;
    v_recsql := 'SELECT cost_centre, description  FROM   cost_centres  where '||c_where;
    -- Create the Record Group
    v_recgrp := CREATE_GROUP_FROM_QUERY('v_recgrp', v_recsql);
    IF NOT ID_NULL(v_recgrp)
    THEN -- No Error, record group has been successfully created.
    -- Populate Record Group
    v_status := POPULATE_GROUP('v_recgrp');
    IF v_status = 0
    THEN -- No Error. Record Group has been Populated.
    POPULATE_LIST('block.CC', 'v_recgrp');
    END IF; -- IF v_status = 0
    -- Delete the Record Group as it is no longer needed.
    DELETE_GROUP('v_recgrp');
    END IF; -- IF NOT ID_NULL(v_recgrp)
    END;thanks for your assistance.

    Hi,
    Once record status gets change for block you can not populate/repopulate the list item. Keep those list items as non-database item with different names and create different items as database orignal items. Than assign the values in WHEN-LIST-CHANGE trigger to the actual database items.
    -Ammad

  • Recording sounds on the fly

    Can anyone tell me if you can record sounds on the fly?
    By that I mean during my voice recording and not in post production.
    Our podcast is a live event. We do no editing or postproduction. Currently I use a PC to play sounds and feed them through the mixer into the line in on my iMac. I was hoping that GB3 podcast recording would allow me to just double click a file and have it added to my mix. I can't seem to figure out how to do this.
    Most podcasters I know do zero post production. I can't understand why Apple wouldn't provide this feature.
    Thanks,
    Bry

    Seems like we both have the same problem! I figured out how to assign an mp3 to a track then drag it to the "Musical Typing Keyboard" See this thread for details:
    http://discussions.apple.com/thread.jspa?messageID=1512131��
    You can also see my thread too, I appear to be asking for the same thing but dragging in each audio track seems way too complicated. I just want to play my audio clips from iTunes (from a little tempary playlist) during my show aka Daily Source Code. Let's figure this ***** out!
    Here is my thread:
    http://discussions.apple.com/message.jspa?messageID=1707459#1707459
    Cheers
    Richard

  • How  do the dynamic state to record image in the cell-phone?

    Excuse me.How do the dynamic state to record image in the cell-phone?Or whether it has the feasibility or not?..Somebody can give me some opinions and data,please.
    Thanks.

    I don't understand very well what you want, but to record and image (get and snapshot) you have to create an Player, realize the player, start it and then get the snapshot. ex:
                player = Manager.createPlayer("capture://video");
                player.realize();           
                VideoControl videoControl = (VideoControl) player.getControl("VideoControl");
                player.start();
                byte[] data = videoControl.getSnapshot(null);
                Image image = Image.createImage(data, 0, data.length);To find out if a device can record images you can use this:
                boolean mmapiAvailable = System.getProperty("microedition.media.version") != null;
                boolean canGetSnapshots = System.getProperty("supports.video.capture") != null;Hope that answer your question.

  • Passing record group to the report...

    Hi
    I am using form 6i ..
    I have got error while passing record group to the report
    Here is the code... , I Wrote it when_button_pressed trigger
    declare
         pl_id paramlist;
    begin
    pl_id := Get_Parameter_List('tmpdata');
         IF NOT ID_NULL(pl_id) then
              destroy_parameter_list(pl_id);
         end if;
         pl_id:=create_parameter_list('tmpdata');
    ADD_PARAMETER(pl_id,'NICE_QUERY',DATA_PARAMETER,'NICE_REC' );
    Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
         RUN_PRODUCT(REPORTS,'E:\DEPT',SYNCHRONOUS,RUNTIME,FILESYSTEM,PL_ID);
    The error is frm-47012 There is no record group with this name nice_rec......
    Thanks

    The error message (FRM-47012) is very specific. Do you have a Record Group defined in the Record Group Node of the Navigator called 'NICE_REC'?
    Hope this helps.
    Craig...
    -- If my response or the response of another is helpful or answers your question, please mark the response accordingly. Thanks!

  • Dynamic creation of record group

    Hi
    Can anyone suggest me with an example about how to create a dynamic record group and attach it to a lov ?
    Regards

    Hi,
    Thanks for your reply
    DECLARE
    rg_name VARCHAR2(40) := 'COMPANY_RANGE';
    rg_id RecordGroup;
    errcode NUMBER;
    lov_id LOV;
    BEGIN
    :System.Message_Level := 0;
    rg_id := Find_Group( rg_name );
    IF Id_Null(rg_id) THEN
    rg_id := Create_Group_From_Query( rg_name||'_TMP', 'select COMPANIES_ID from SYSMODULE.COMPANIES where 1=2');
    Set_LOV_Property(lov_id,GROUP_NAME,rg_name||'_TMP');
    rg_id := Create_Group_From_Query( rg_name, 'select COMPANIES_ID from SYSMODULE.COMPANIES');
    IF Id_Null(rg_id) THEN
    Message(' Create group failed');
    Message(' ',no_acknowledge);
    Raise Form_trigger_failure;
    End if;
    END IF;
    errcode := Populate_Group( rg_id );
    lov_id := Find_LOV('LOV7');
    Set_LOV_Property(lov_id,GROUP_NAME,rg_name);
    END;
    The above code, I have placed in when new form instance .. still the same error
    when new block instance --- same error
    in push button --- same error
    FRM-30048: Unable to find record group .
    LOV LOV7
    Form: DYNAMIC_LOV_CREATION
    FRM-30085: Unable to adjust form for output.
    Where i am going wrong ..
    Regards

  • Record group in the CUSTOM.pll lib...

    Hi,
    According to the Developer's Guide (page 28-3) ...
    "You cannot use any SQL in the library. However, *you can use a record group to issue SELECT statements*, and .....".
    Is there any example, document showing this approach...????
    Note: I use EBS 11.5.10.2
    Thank you,
    Sim

    Hi ashok:
    Please check below and see its helpful:
    HOW TO DELETE OR ADD COLUMN NAMES FROM AN LOV COLUMN MAPPING [ID 1064257.6]
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/frm_tabular.htm
    Also please check:
    FAQ For Oracle Quality Application for Setup, Charts and Reports, and General Questons [ID 395807.1]
    Regard
    Helios

  • Setting the update property of the row of a records group to false IN ORACL

    hello
    i have to populate a records group with the previous records user had entered as well as enable the user to enter new record in that RECORD GROUP IN ORACLE 6I FORMS.
    I want that previous record that user had entered caN NOT BE EDIT .USER CAN SEE THESE RECORDS ONLY AND ACCORDINGLY ADD NEW RECORDS IN SAME RECORD GROUP.
    PL TELL ME HOW TO DO THIS.
    THANKS & REGARDS
    VISHAL AGRAWAL

    I also try for which u mentioned earlier but it is like selectting individual records to display in my tablular record group.
    we are using following code for fetching data and displaying it into records group and also making all fetched record disabled.
    code is given below :
    PROCEDURE fetchdata(mf char) IS
    cursor c1 is select dateofmtrl,rm1,rm2,rm3 from rawmtrl_graph
    where
    dateofmtrl between TO_DATE(TO_CHAR(ADD_MONTHS(SYSDATE, 0),'YYYYMM'),'YYYYMM') and
    TO_DATE(TO_CHAR(ADD_MONTHS(SYSDATE, + 1),'YYYYMM'),'YYYYMM') - 1 and
    mtrl_flag = mf
    order by dateofmtrl ;
    r1 c1%rowtype;
    lstrec number;
    cnt number :=1;
    BEGIN
    go_block('dtl');
         last_record;
    lstrec:=:system.cursor_record;
    for ctr in 1..lstrec
    loop
         delete_record;
    end loop;     
    first_record;
         open c1;
         loop
              fetch c1 into r1;
              exit when c1%notfound;
              if :dtl.date1 is not null then
                   next_record;
                   end if;
                   :dtl.date1:=r1.dateofmtrl;
                        :dtl.opc:=r1.rm1;
                             :dtl.ppc:=r1.rm1;
                                  :dtl.total:=r1.rm1;          
         end loop;
         close c1;
    last_record;
    lstrec:=:system.cursor_record;
    first_record;
    for ctr in 1..lstrec
    loop
    SET_record_PROPERTY(:system.cursor_record,'dtl',ENABLED,PROPERTY_FALSE);
    SET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'dtl',UPDATE_ALLOWED,PROPERTY_FALSE);
    SET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'dtl',insert_allowed,PROPERTY_FALSE)
    next_record;
    end loop;     
         first_record;
    END;
    But it is not working...
    givinng the erros that no such property for set_record_property
    pl tell me how to modify the code to disable some selected raws in a record group............

  • Dynamic record group

    Please explain me step by step to create dynamic record group and populate it into my combo box.
    thanks
    rupal
    Edited by: rupearlkaushal on Jun 13, 2012 9:39 PM

    hi
    plz check out the following threads.
    Dynamic creation of record group
    and
    Dynamic Record Group
    LOV (List of Values)
    LOV is nothing but a form item which is used to provide list of values to a text field.
    Each LOV contains a Record Group which provides the data to the LOV
    Record Group
    A record groups contains the query which is used to populate the values to the LOV.
    To alter a list of values(LOV) of a text field, we should change the query of the
    record group which is attached to the corresponding LOV or we should create a
    new record group and attach it to the existing LOV.
    Note : We cant create a new LOV. But we can attach a exsiting LOV to a form field.Method 1: Changing the query of the existing Record group
    declare
    rg_id RECORDGROUP ;
    err number;
    lv_id lov;
    begin
    rg_id:=find_group('LOV4'); -- LOV4 is the name of the existing LOV
    if not id_null(rg_id) then
    err:=populate_group_with_query(rg_id,
             'select deptno from dept where dname=''SALES''');
    end if;
    lv_id:=find_lov('LOV4');
    set_lov_property(lv_id,group_name,rg_id);Method 2: Creating a new Record Group if doesn't exists
    declare
    rg_id recordgroup;
    pg_num number;
    lv_id lov;
    begin
    rg_id:=find_group('MYGROUP');  -- MYGROUP is the Group Name
    if id_null(rg_id) then
    rg_id:=create_group_from_query('MYGROUP','SELECT 100 deptno FROM dual');
    end if;
    pg_num:=populate_group(rg_id);
    lv_id:=find_lov('LOV4');sarah
    Edited by: Sarah on Jun 13, 2012 9:56 PM

  • 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 : Record Group Problem

    hello all
    i have a problem regarding record group.
    i want to populate my record group with a dynamic clause which is
    "and main_code not in ('02725','02868')"
    and my record group query is
    "select mt.main_number from main_table mt,main_parent mp
    where mt.main_code = mp.main_code
    and mt.main_code not in (:parameter.param_main_code)"
    now i am adopting the following method for populating the
    LOV(list of values) which is attached to a text item:
    assigning values i.e. '02725','02868' to my parameter object i.e. :parameter.param_main_code but the record group is not giving changd results according to my criteria i.e.'02725','02868'...
    does any body knows the solution for this problem..kindly help him with it..logically the record group query should work and return a changed results for the LOV..
    please help me with this.....
    thank you.

    I thing you can't able to do what you are trying to do, but you can achive this by using dynamic record group.
    Create the dynamic record as same struncture of design time then populate it by the coding.
    Sample Code is
    declare
         l_rec_name RecordGroup;
         l_rec_col GroupColumn;
         l_rec_col1 GroupColumn;     
         cursor l_ename is select ename from emp;
         l_row number(12):= 1;
    begin
         l_rec_name := create_group('rg_dynamic',Form_scope, 100);
         l_rec_col := add_group_column(l_rec_name,'ENAME',char_column,30);
         l_rec_col1 := add_group_column(l_rec_name,'EMPNO',number_column,6);     
         for i in l_ename
         loop
              add_group_row(l_rec_name, end_of_group);
    set_group_char_cell(l_rec_col,l_row, i.ename);
    set_group_number_cell(l_rec_col1,l_row, l_row);
    l_row := l_row+1;
         end loop;
         :parameter.num_rows := l_row -1;
         set_lov_property('LOV5',group_name,'RG_DYNAMIC');
    end;
    I hope this will help you to solve this problem.
    [email protected]

  • Record group help

    Hi
    I have an enquiry form in which there are 2 text items and a push button.User have to input a value in text box 1 and press the button.The sql in the button press trigger will fetch a value from database and displays in text item 2.
    But this the performance is bad in that way.
    Is there any alternative to this scenario.Can i populate the data in a record group and query against that record group in the button-press?
    Your help will be very much appreciated.
    thanks and regards
    Ajjay

    Hi
    I have an enquiry form in which there are 2 text
    items and a push button.User have to input a value in
    text box 1 and press the button.The sql in the button
    press trigger will fetch a value from database and
    displays in text item 2.
    But this the performance is bad in that way.
    And why you think it is bad performance???
    If your SQL statement's execution is slow, it will be slow everywhere, regardless where you are executing it, in a record group, PL/SQL, etc....
    You should find out why the statement is slow.
    There will be no significant difference if you use it in a record group.
    Tony

  • Record Group Urgent

    I am trying to populate a record group at runtime. This record group is based on query.
    My SELECT statement has a where clause. To this where clause i pass a CHARACTER value in single quotes.But its show error CANNOT CREATE RECORD GROUP.
    But if i pass a numeric value it works fine.
    Can any one tell me how to pass a character value in single quotes to a select statement which itself is in single quotes.
    thanx in advance
    Please mail the solution [email protected]
    navneet jain

    If I understood what you're asking...
    'select ... where columna = ''a'' and columnb = 1'
    (note the two 's - they are not a ")

  • Re-populating of Record Group

    I am facing error, while trying to re-populate a record group.
    In progaram unit 'AA', I have the following code: -
    declare
    rg_examp_code RECORDGROUP;
    errcode number;
    begin
    rg_examp_code := FIND_GROUP('examp_code');
    IF ID_NULL(rg_examp_code) THEN
    c_sql := 'SELECT TRIM(field_code) label, TRIM(field_code) lstvalue FROM prod';
    rg_examp_code:= CREATE_GROUP_FROM_QUERY('examp_code',c_sql);
    errcode :=POPULATE_GROUP(rg_examp_code);
    CLEAR_LIST('EXAMP_CODE');
    POPULATE_LIST('EXAMP_CODE',rg_examp_code);
    end;
    After that, In aother program unit, I am inserting a new record in table prod using EXEC_SQL.
    Now, table prod contains one extra record after successfull insertion of a row. Here, I am populating the List using the above query, once again.
    and getting error FRM-41072 : Cannot create Group examp_code.
    Please help

    Your record group name should not be the same as your list item name. I made other changes too. Try this:
    declare
      rg_examp_code RECORDGROUP;
      errcode number;
    begin
      rg_examp_code := FIND_GROUP('examp_code');
      IF NOT ID_NULL(rg_examp_code) THEN
        DELETE_GROUP(rg_examp_code);
      END IF;
      c_sql := 'SELECT TRIM(TO_CHAR(field_code)) label, TRIM(TO_CHAR(field_code)) lstvalue FROM prod';
      rg_examp_code:= CREATE_GROUP_FROM_QUERY('examp_code', c_sql);
      errcode := POPULATE_GROUP(rg_examp_code);
      IF errcode = 0 THEN
        CLEAR_LIST('Your_List_Item');  -- not needed when using POPULATE_LIST
        POPULATE_LIST('Your_List_Item', rg_examp_code);
      ELSE
        MESSAGE('Record Group Error: ' || errcode);
        MESSAGE(' ', NO_ACKNOWLEDGE);
    end;

  • Whats a 'record group'?

    Whats a 'record group'?
    "To retrieve and store the contents of a list to a record group, use the RETRIEVE_LIST built-in subprogram. "
    this is what i read for the retrive list built-in help doc.
    but what exactly is a record group.
    is it an item, a record or a lov or what?

    You can think of record groups as in memory arrays. They can be an Item in your form - look at the object navigator and you'll see the record group node. But they can also be created dynamically at runtime.
    More info is in the online help.

Maybe you are looking for