Record group problem

hi all
i make a record group in my form (developer 6i).
in runtime i want to find a special record in this record group.
what is the best way?
thanks in advance.
shoja

You can loop through the members of the record group using GET_GROUP_ROW_COUNT to get the number of members and then the various get_group_..._cell built-ins to get the value of a column for each row

Similar Messages

  • 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]

  • 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

  • Dynamic Record Group problem

    I am trying to assign LOV to a field on 6i form programatically. Here is the procedure I created.
    PROCEDURE XXSAG_RECGROUP IS
    XXSAG_ACCOUNT_RG               RECORDGROUP;
    val                                   number;
    val_chosen               boolean;
    raise_error               exception;
    BEGIN
    if (id_null(XXSAG_ACCOUNT_RG)) then
    XXSAG_ACCOUNT_RG := Create_Group_From_Query('ACCOUNT_NUMBER','select account_number'||' from xxsag_prod_producer_info'
                   ||' where production_id = :xxsag_prod_main.production_id'
                   ||' and account_type = :xxsag_prod_producer_info.account_type ');
                   val := Populate_Group(XXSAG_ACCOUNT_RG);
                   If val != 0 then
                        delete_group(XXSAG_ACCOUNT_RG);
                        raise raise_error;
                   End If;     
                   set_lov_property('ACCOUNT_NUMBER_LIKE',GROUP_NAME,'XXSAG_ACCOUNT_RG');
                   set_item_property('XXSAG_PROD_PRODUCER_INFO.ACCOUNT_NUMBER',LOV_NAME,'ACCOUNT_NUMBER_LIKE');
                   delete_group(XXSAG_ACCOUNT_RG);
              end if;     
    END;     
    However, when the cursor goes to the field, I see the LOV toolbar but no records show up. Please help.
    Thanks.

    Please explain why you need to create the group during run-time. I don't see anything in your code that might require this.
    Are you just trying to change the contents of the LOV based on the values in production_id and account_type? I think setting Automatic Refresh to YES might do it.

  • 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.

  • 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.

  • Report based on a reord group - PROBLEM

    Using Reports Server / Forms/Reports 6i
    I am trying to run a report based on a record group on the web. It fails giving the error 'Cannot run report.'
    The report is called from a form and the record group is passed as a data parameter. It works fine in Client/Server.
    I have tried to remove the data parameter and run the report without it but, despite working in the Client/Server environment, it still fails on the Web.
    Does anyone have any suggestions?

    I have found the answer to my problem in the forms forum!
    Apparently, this type of report won't work on the web and I have to use temporary tables!

  • 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

  • Using Global variable in Record Group

    Hi,
    I have a requirement where in I need to pull a column name from a table and then use that value in the select statement of a record group. I have tried using global variables but it is not working. Here is the record group I would like to use.
    RG_DOMAIN is based on LOV_DOMAIN
    SELECT :GLOBAL.DOMAIN_COLUMN_NAME, DESCRIPTION FROM
    DM_T_DOMAIN_VALUES
    WHERE DOMAIN_NAME := BLOCK.ATTRIBUTE;
    In the Key-Listval I have a select statement in which does this :
    SELECT DOMAIN_COLUMN
    INTO :GLOBAL.DOMAIN_COLUMN_NAME
    FROM DM_T_DOMAIN_RULES WHERE DOMAIN_NAME = :BLOCK.ATTRIBUTE;
    SHOW_LOV('LOV_DOMAIN');
    The problem is I am not getting the value I am just getting the Domain_column name. For example for Domain_name 'CALC_TYP' the Domain_column is COLUMN_10 and I just see COLUMN_10 my LOV when I want to see the value of COLUMN_10 from the DM_T_DOMAIN_VALUES table.
    I tried using Name_in and Copy but not working. Can anyone suggest a solution?
    Thanks

    Francois ,
    I tried this but I am getting error saying record group does not exist. Can you tell me what should I go in Populate_group... and show_lov..maybe I am doing something wrong?
    Declare
    LC$Req Varchar2(512) ;
    Begin
    LC$Req := 'SELECT ' || :GLOBAL.DOMAIN_COLUMN_NAME || ' FROM ....' ;
    Create_Group_From_Query( rg_group, LC$Req ) ;
    Populate_group(RG_DOMAIN); ?? --- is this correct?
    Show_Lov(LOV_DOMAIN) ; -- and is this correct?
    End;

  • Dynamic record group not working when apostrophes are used

    Hi Everyone,
    I have developed a Form for the most part everything is working as expected. However, there is a search functionality that is giving me problems. The issue is that when the user enters search criteria for last_name that has an apostrophe (O'brian) the search lov doesn't get populated because the dynamic record group is not getting created when the string has an apostrophe (ie O'brian). I have a dynamic record group that takes the user's search criteria and populates an LOV on the screen with the records that matched their criteria.
    Here is the code that is behind my search button where the dynamic RG gets created. It works fine for all searches that don't contain an apostrophe. Btw, the Oracle Forms version is 10g.
    DECLARE
    p_where_debtor varchar2(2000);
    p_where_liab varchar2(2000);
    rg_id RecordGroup;
    v_query varchar2(2000) := null;
    rg_name varchar2(2000):= 'RG_LIAB_LST';
    errcode NUMBER;
    BEGIN
    IF :SEARCH.cd_nb is null and
    :SEARCH.cd_seq is null and
    :SEARCH.f_name is null and
    :SEARCH.l_name is null and
    :SEARCH.mi_name is null
    then
    display_message ('Search criteria must be entered');
    raise form_trigger_failure;
    END IF;
    v_query := 'SELECT last_name, first_name, middle_name, c_no, c_seq
    FROM TABLE_VW2 WHERE 1=1';
    /*Search criteria entered by user*/
    IF :SEARCH.l_name_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(last_name) LIKE '''||UPPER(:SEARCH.l_name)||'%''';
    END IF;
    IF :SEARCH.f_name_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(first_name) LIKE '''||UPPER(:SEARCH.f_name)||'%''';
    END IF;
    IF :SEARCH.mi_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(middle_name) LIKE '''||UPPER(:SEARCH.mi_name)||'%''';
    END IF;
    IF :SEARCH.cdcs_nbr_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(c_no) LIKE '''||UPPER(:SEARCH.cd_nb)||'%''';
    END IF;
    IF :SEARCH.cdcs_seq_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(c_seq) LIKE '''||UPPER(:SEARCH.cd_seq)||'%''';
    END IF;
    /*Make sure record group doesn't exisit*/
    rg_id := Find_Group(rg_name);
    /*If it doesn't exist then create record group*/
    IF id_null(rg_id) THEN
    rg_id:= create_group_from_query(rg_name,v_query);
    END IF;
    IF NOT id_null (rg_id) THEN
    delete_group (rg_id);
    rg_id:= create_group_from_query(rg_name, v_query);
    END IF;
    errcode := Populate_Group(rg_id);
    Any help would be greatly appreciated.
    Thanks,
    Adrian

    For every item where an apostroph can occur, do a
    REPLACE(:BLOCK.ITEM, '''', '''''');

  • Tree based on Record Group

    Hi guys i have a tree that i populate using
    FTREE.Set_Tree_Property(tree_item, FTREE.RECORD_GROUP, rg_Tree_Id);     The problem is that my query is fine but the parent child relationships are not working.
    The help on forms is terrible for trees and i cant find any information anywhere else.
    As anyone any example of how this works?
    my record group contains data such as this
    child level     parent
    203096     1     203094          
    203097     1     203094          
    203098     1     203094          
    203099     1     203094          
    203100     1     203094          
    203101     1     203094          
    203102     1     203094          
    203103     1     203094          
    203104     2     203096          
    203105     2     203096          
    203106     2     203096          
    203107     2     203096          
    203108     3     203107          
    203109     4     203108          on displaying the tree the tree displays with all the information but the branches are in the order as above, they do not branch off the correct parent i.e. 203104 should branch off 203096 but it doesnt it branches off 203103 as this is the one above it, and the level is the only thing that has changed.
    any ideas?

    Hai,
    In Tree, the values should be in the order.
    that means,
    parant 1 - 100000
    child 1 100001
    child 2 100002
    parant 2 200000
    child 1 200001
    like that.
    Regards,
    Manu.

  • Using JDAPI to manipulate record group

    Hi.
    I am doing a migration from oracle forms 4.5 to 10g. For now I was able to manage/fix everyting using JDAPI interface. Now I am stuck with the following problem. In forms 4.5 it was perfectly legal to use a value of record group column larger than data length of that column. From forms 6+ there is a runtime error generated when this situation is met. What I wanted to do is to change/truncate record group value to the length of that column using JDAPI. No matter how I search I cant find proper metod to do the job. That is to change the value of record group column. Did anybody had a similar situation and was able to solve it.
    Best regards.

    Hi.
    I am doing a migration from oracle forms 4.5 to 10g. For now I was able to manage/fix everyting using JDAPI interface. Now I am stuck with the following problem. In forms 4.5 it was perfectly legal to use a value of record group column larger than data length of that column. From forms 6+ there is a runtime error generated when this situation is met. What I wanted to do is to change/truncate record group value to the length of that column using JDAPI. No matter how I search I cant find proper metod to do the job. That is to change the value of record group column. Did anybody had a similar situation and was able to solve it.
    Best regards.

  • 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 .

  • URGENT,FRM-41337: Cannot populat the list from record group

    Hi all:
    Can anyone help me in that problem?
    I have a database item in the block as a list item with combo box style and I use this code in WHEN-NEW-RECORD-INSTANCE at the form module level to populate that combo box list:
    DECLARE
         group_id RECORDGROUP := FIND_GROUP('group');
         list_id ITEM := FIND_ITEM('employees.job_id');
         x number;
    BEGIN
    IF NOT ID_NULL (group_id) THEN
              DELETE_GROUP (group_id);
         END IF;
              group_id := CREATE_GROUP_FROM_QUERY ('group','select name,TO_CHAR(id) job from cmn_jobs where job_type_id = 4720 ');
         x := POPULATE_GROUP (group_id);
         POPULATE_LIST (list_id, group_id);
         EXCEPTION
    WHEN NO_DATA_FOUND THEN
    null;
         END;
    That code worked very well and without any problem, but when I change the list item from combo box style to poplist style then the forms give that error:
    FRM-41337: Cannot populat the list from record group
    And an additional null/blanke element appears in the poplist with original element that come from RECORDGROUP.
    So can anyone help me to solve that problem please?

    First, how I can assign a default or initial value DYNAMICALLY to my poplist.Set the default-value to a parameter like :PARAMETER.MYPARAMETER then you can assign the desired default-value to the parameter.
    second, if I have popliste say X for example depend on another poplist say Y ,so when I put the code to populate popliste X on WHEN-LIST-CHANGED on popliste Y and make query then the >forms return FRM-40301 Query caused no records to be retrieved ,but when I have a copy for that code in WHEN-LIST-CHANGED and put it in WHEN-NEW-FORM-INSTANCE at the form >module the form work and returns records, so is it any error or exception in what I did.Can't answer that, you should check :SYSTEM.LAST_QUERY to see why the query does not returnany records.
    At the last, which better to put the code for popliste in PRE-FORM trigger at the form module or in WHEN-NEW-FORM-INSTANCE at the form module.I would use the PRE-FORM-trigger

  • Record Group and From-Clause Datasource

    I need to do several complex queries (read-only) for my form. Original I used From-Clause datasource but, as the requirement changed, there are some limitations. I would rather no do anything dynamically if as all possible because there are over 20 such queries which makes the code difficult to maintain. I wanted to be able to reference block items in the query.
    I'm thinking about using Record Group query instead. What are the differences in capability between Record Groups and From-Clause Datasource?
    Thanks.
    Clayton.

    Thanks.
    That's exactly the problem I have. I don't want to use LOVs so I've been thinking about how to visualize the record group data using data blocks. Perhaps I'll just go with dynamically building the From-Clause.
    I've looked into stored procedure based blocks a bit; it was confusing for me. Are the stored procedures stored in the database or are they defined in the form?

Maybe you are looking for