Populating List Item

HI !
I want to populate List item , from table using SQL query,
e.g. select * from dept_name,dept_no from dept; and want to save deptid. i.e list item disply only dept_name and store/save dept_id as it is foreign key.
Thanks & Regards !

Hi !
I have adopted this technique.
I have made function combo_population :
PROCEDURE COMBO_POPULATION(COMBO_NAME VARCHAR2, COMBO_LIST VARCHAR2)
IS
     rg_num number;
BEGIN
     rg_num := populate_group(combo_name);
populate_list(combo_list, combo_name);
END;
I create record group dept_rg (select deptname,to_char(deptid) from dept)
And i called function at when-new-form-instance
combo_population('dept_rg','emp.empdepart');
It works very well only it shows list of department Name, and save department id only.(noted that, on form the list item is deptid and only change its type to varchar2 then above function works well).
Regards!

Similar Messages

  • Populating List item on condition.

    -- I am populating List item based on the Record Group.
    i.e: select casenature,to_char(casenaturecode) from casenature.
    -- But when i restrict to display associated record with of another field.
    i.e : select casenature,to_char(casenaturecode) from casenature
    where casenamecode = :cases.case_namecode
    -- it does not display any record in the list item
    Plz, help me in this regard.
    Thanks in advance.

    This is a "standard" lookup:
    Create a non-database-item in your databaseblock with the datatype and length of the text to be shown (casenature). I assume that there is a casenaturecode-item in your databaseblock which is populated from the database.
    Create a POST-QUERY-trigger on your block and read the value from the database:
    DECLARE
      CURSOR cr IS
        SELECT CASENATURE
          FROM THETABLE
         WHERE CASENATURECODE=:BLOCK.CASENATURECODE;
    BEGIN
      OPEN cr;
      FETCh cr INTO :BLOCK.THE_NEW_TEXT_ITEM;
      CLOSE cr;
    END;
    -- Mark record as valid
    SET_RECORD_PROPERTY(:SYSTEM.TRIGGER_BLOCK, :SYSTEM.TRIGGER_RECORD, STATUS, QUERY_STATUS);Create an Lov conatining both casenaturecode and casenature, set length of casenaturecode to 0, assign the lov to the new textfield and set "Use Lov For Validation"="Yes" for the textfield.

  • Populating List Item From View

    I have two data blocks in my form, one named USERS which contains updateable fields to a table from the view and another data block called CONTROL which are all list items that currently populate on a WHEN-MOUSE-CLICK trigger. The list items work as expected for the WHEN-MOUSE-CLICK trigger. However, my problem is trying to populate the list items based on a selection previously chosen and saved to the table (yes, the values are in the table and are selectable through the view). I have a seperate population for this occurrance in the WHEN-NEW-FORM-INSTANCE at the form level, as well as on KEY-SCRUP, KEY-SCRDOWN, WHEN-NEW-RECORD-INSTANCE, and POST-QUERY at the USERS data block level. The only way the list items populate on a previously chosen and saved value is if you choose (WHEN-MOUSE-CLICK trigger) the list of values and save. From then on, as I scroll through the data retrieved in the USERS data block the corresponding data in the users view shows up in the CONTROL block list items. How do I get my form to initially show the corresponding list item data on form load when it is already in a WHEN-NEW-FORM-INSTANCE and POST-QUERY trigger on form load?
    Thanks in advance for any clue to point me in the right direction.
    Kyle
    Edited by: Kyle Miller on Sep 29, 2008 3:09 PM

    The form is for editing a current student information system user who we will be extracting data for an OBIEE IDM import. All of the fields displayed in the OBIEE_USERS data block can be edited. For the CONTROL block list items I would like them to display the current value chosen for the user displayed in the OBIEE_USERS data block. When the CONTROL block list items are clicked on then a list of values are displayed in which the logged in form user can chose another value which ultimately changes the choice for the user displayed in the OBIEE_USERS data block. This all works fine in my current form except the list items do not display the current user selected in the OBIEE_USERS data block's saved value until the list item is selected, a value chosen, and a save is committed to the table tied to the OBIEE_USERS data block. From that point I can scroll through the OBIEE_USERS block and the list item displays the correct value for the selected user, if there are values (some users have NULL values). I have currently worked around this issue by displaying the fields in the OBIEE_USERS block and only use the list items for the changing selection. I did this because I needed a proof of concept for the pilot roll-out and could no longer wait to figure this issue out (it should be more simple it seems). I am still interested in resolving this as I feel it is a great functionality for the form.

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

  • Material staging indicator not populating in prod order WM pick list item

    Hello,
    I have an issue with material staging in an prod order
    1) PP-WM interface is activated
    2) Control cycle for material is created
    3) Production storage location is created for material
    4) storage type is 100 for production
    5) There is one discontinued material and also the follow up material
    6) stock of discontinued material is zero and requirement are passed to follow up material
    When we confirm the order the stagging indicator for both follow up material as well as discontinued material automatically populates zero (Non relevence to pick list items) where as it should be one (1 - for pick list items).
    One more issue user has manually inserted discontinued material as well as follow up material in production order change mode.
    In the BOM of a main material both discontinued as well as follow up material is there with some quantity as a component.
    For the same work center, control cycle , production storage location the indicator is populating.
    These two material (discontinued as well as follow up) are appearing twice in the WM pick list screen where first two line items are OK and populating indicator "1". But in line item last and second last indicator is not there.
    My question is why the stagging indicator is not automatically populating in the production order WM pick list screen in front of components.

    Unfortunately, WM material staging via production orders is not possible
    from the pull list.  Please see the long text of message RMPU 311
    (WM material staging for production order reservation not possible):
    "You cannot carry out a WM material provision for pick parts from
    production order reservations in the pull list". The reasons for this
    are cleary explained in the SAP on-line documentation via the
    following path :
      Logistics -> Logistics Execution -> Warehouse Management Guide ->
      Goods Issue -> Goods Issue for Production Supply ->
      Material Staging for Repetitive Manufacturing
    See the following under the Selection heading :
    The choice of the selection type influences which types of WM material
    staging are supported in the pull list. However, the pick parts can be
    staged via RS headers/planned orders but not with the current BOM
    explosion. The release order parts, on the other hand, can also be
    staged if the current BOM is used for calculating the dependent
    requirements.
    WM material staging via production orders is not possible from the pull
    list.
    I think you may try in CO02 or COR2 for production order or process order.

  • List item - Population - Based on Data setup

    Dear All,
    I need to populate the list item based on data defined at the database level.
    Tables Used:
    Table 1 : JBCAI_JOB_COM_ADD_INFO
    Column Name     Pk     Null?     Data Type     Default     
    JBEDC_UID          1     N     NUMBER (22)          
    JBCAI_ADD_INFO_CODE     2     N     VARCHAR2 (2 Char)          
    JBCAI_INFO_CODE_SEQUENCE      3     N     NUMBER (3,1)     1     
    JBCAI_ADD_INFO_TEXT     Y     VARCHAR2 (35 Char)          
    SHIPCOMP_CODE     N     VARCHAR2 (4 Char)     
    Table 2 :CODES
    CODE_TYPE CODE_VALUE DESCRIPTION NEXT_VALUE CODE_FLAG
    MCAR 01 Customs References 01 NULL N
    MCAR 02 Customs References 02 NULL N
    MCAR 03 Value of Commodities NULL N
    MCAR 04 Currency of commodities NULL N
    MCAR 05 Purchase Order Number NULL N
    MCAR 06 Other NULL N
    MCAR 07 Consignee Name NULL N
    MCAR 08 VIN NULL N
    FORMS Section
    =========
    JBCAI_ADD_INFO_CODE are the list items which needs to be populated; JBCAI_ADD_INFO_TEXT(free text) which user can enter any descriptions.
    References - Label of the Block
    JBCAI_ADD_INFO_CODE JBCAI_ADD_INFO_TEXT
    Customs References 01 - Free Text()
    Customs References 02 - Free Text()
    Value of Commodities - Free Text()
    Currency of commodities - Free Text()
    Purchase Order Number - Free Text()
    Other - Free Text()
    Consignee Name - Free Text()
    VIN - Free Text()
    VIN - Free Text()
    Business Rules:
    If JBCAI_ADD_INFO_CODE has the flag as 'N' in CODES table then user can select only one time from the list item.
    If JBCAI_ADD_INFO_CODE has the flag as 'Y' in CODES table then user can do multi-selection from the list item e.g; VIN
    How the records are fetched:
    Value for the list item are been populated from CODES table ; which am doing through the below query.
    In WHEN-NEW-FORM-INSTANCE am using the below code:
    PROCEDURE p_fetch_code_value
    IS
              l_query VARCHAR2(200) ;
              l_rg_name VARCHAR2(40) := 'CODES';
              l_errcode NUMBER;
              l_rg RECORDGROUP;
         BEGIN
              l_query := 'SELECT adcod.description description,adcod.code_flag code_flag FROM codes adcod WHERE adcod.code_type = ''MCAR''                    AND adcod.code_value IN (''01''''02'',''03'',''04'',''05'',''06'',''07'',''08'') ORDER BY code_value';
              l_rg := FIND_GROUP( l_rg_name );
              IF ID_NULL(l_rg) THEN
              l_rg := CREATE_GROUP_FROM_QUERY(l_rg_name, l_query);
              END IF;
              l_errcode := POPULATE_GROUP( l_rg );
              POPULATE_LIST('BLK_CONTROL.JBCAI_ADD_INFO_CODE',l_rg);
    EXCEPTION
    Handled WHEN OTHERS exception
    END p_fetch_code_value;
    Saving of Record:
    List value selection are saved to JBCAI_JOB_COM_ADD_INFO.JBCAI_ADD_INFO_CODE column.
    Free Text is saved to JBCAI_JOB_COM_ADD_INFO.JBCAI_ADD_INFO_TEXT column.
    Doubt:
    When i select the first list item value i.e Customs References 01 and then enter some description i.e free text and moved to the next list item; the value Custom reference 01 should not be visible wheras the other values should have to be visible e.g; Customs Reference 02,Value of Commodities.....
    Please help and let me know how can i acccomplish this task?
    Thanks....
    Regards,
    Sunil.G

    Hi Sarah,
    Thanks for your reply.
    There is no issue in the population of the list item; it is working fine with the query which i have pasted.
    My doubt is:
    There are few places where i have set the code_flag as 'Y' / 'N'.
    For the first time when user selects the list item; all the values should be shown.....
    If user has selected the first list item i.e Customs Reference 01 for which the code_flag is 'N' from a multi-record block; then when he moves to the further lines the previous selection for which the flag is set as 'N' should not be shown(if user has already selected once) e.g; 'Customs Reference 01' should not be shown again if user has made the selection before.
    Plz revert incase more explanations required.
    Thanks...
    Regards,
    Sunil.G
    Edited by: Sunil G on Nov 29, 2009 12:16 AM

  • Oracle Forms List Items :not populating list Dynamically using select Query

    Hi ,
    I need to create a list item. And the values to be populated in the list are from Database but I'm unable to populate from database.
    Please help me out how to populate the values from database.
    In Property Pallete we have Elements in List under Functional section , In this we have to manually enter the List values but we can't use any Query to Dynamically populate.
    Thanks,
    Kiran Sanga

    When you need to fill a list with the result of a query, you'll have to do it at runtime.
    Andreas has a good blogpost about this.

  • Populating a text field depending on what is selected in list item field

    I have A form which contains a ROOM_REF field which is a list item, and a ROOM_DESC field which is a text item. (among other things).
    When the user selects from the ROOM_REF field (which is populated by a record group on startup),
    I want it to automatically populate the ROOM_DESC field with the coresponding (read only) data.
    Which kind of trigger do I need to use and with what code?
    Something like:
    SELECT ROOM_DESC FROM ROOM WHERE ROOM_REF = :SESSION.ROOM_REF;
    Thanks

    Did you try this code in WHEN-LIST-CHANGE trigger of list item.
    SELECT ROOM_DESC INTO :ROOM_DESC FROM ROOM WHERE ROOM_REF = :SESSION.ROOM_REF;-Ammad

  • Dynamic Population of List Item Not Working

    My requirement is to have 1 list item that is populated based on the value selected for a second list item. in the when-list-changed trigger of the second list item, i make a call to a procedure (code below). This seems to not like any of the clear_list or populate_list. the list item type is poplist. i set the class to list. if i use populate_list in when-new-form-instance, there's no problem. PLEASE HELP. When can't I populate list using a procedure??
    ERROR: frm-40734 internal error pl sql error occurred
    PROCEDURE Refresh_List IS
    v_rg_name VARCHAR2(40) := 'RGTEST';
    v_rg_id RecordGroup;
    v_sql varchar2(2048);
    problem EXCEPTION;
    status number;
    list_id item;
    BEGIN
         list_id := Find_Item('BLK_TEST.LST_TEST');
    v_sql:='select column_name from sys.all_tab_columns where table_name=''testtable''';
                   v_rg_id := Find_Group( v_rg_name );
                   IF Not Id_Null(v_rg_id) THEN
                             DELETE_GROUP( v_rg_id ) ;
                   End if;
                   clear_list(list_id);
                   v_rg_id := Create_Group_From_Query( v_rg_name, v_sql ) ;
                   status := Populate_Group( v_rg_name );
                   POPULATE_LIST(list_id, v_rg_id);
                   POPULATE_LIST('BLK_TEST.LST_TEST', 'RGTEST'); also tried this.
                   if status <> 0 then
                             raise problem;
                   end if;
              EXCEPTION
                   WHEN problem THEN
                             message('problem.');
                   WHEN others THEN
                             message('tooto');
    END;

    Thanks for the response. I've tried this example too and it still doesn't like the things mentioned in previous post. In addition, it doesn't like SET_RECORD_PROPERTY(:system.cursor_record,'EMP',status,new_status); I get the same sort of error. The form compiles fine though.
    Background on form:
    this form was created to allow users to dynamically build an update statement. On this form are a number of list items and text boxes that are not populated from a database. So the datablock doesn't retrieve values from the database and the only updating that will be done is when the user clicks an "update" button to execute the sql statement that is built. Could this issue I'm having be related to the way i designed my datablock and items? When the user selects an item from one of the list items, the record status goes to "Changed". So I assumed my issue was because of this and thought the set_record_property statement would help...but that is generating the same error. what am i missing? if i look at the index value of the record group after create_group_from_query, it is -1. after populate_group, it is still -1. should it still be -1?? any help is greatly appreciated.

  • Help needed: Populating a list item

    I want to populate a list item (combobox) on a form with data from a column in a table, how do I do that? Please help. I am using Developer Suite 10g.

    Thanks Andreas, I found the link very helpful. I have managed to populate the list item.

  • List Item problem in oracle forms

    Hi,
    I am using list item in oracle forms 6i and facing one problem. I am populating list using following built-in.
    Clear_list()
    Create_Group_From_Query( )
    Populate_list()
    The problem I am facing is when list gets populate it keep the cursor at last element of list with null value. I want cursor to go at first item in the list. Is this thing is possible. The list item I am using is pop-list. In combo its showing list perfectly but I have to use pop-list only. Please help to come out of this problem.
    Thanks in advance
    Shweta.

    Hi Shweta,
    Please post your query in Oracle Forms discussion forum.
    Thanks,
    Wilson.

  • Problem with List Item in oracle forms

    Hello Experts,        
                         I am new in oracle forms and i am using oracle forms 11g with weblogic 10.3.5 at windows 7.
    I have 3 database tables say(tbl_city,tbl_state,tbl_address).
    tbl_city
    C_ID
    C_name
    S_ID
    0
    None
    0
    1
    XYZ
    1
    2
    AS
    2
    3
    AXD
    2
      tbl_state
    ID
    s_ID
    S_Name
    0
    None
    1
    XY
    2
    ASD
    tbl_address
    A_ID
    A_Street
    S_ID
    C_ID
    1
    ABC
    1
    1
    Now I have made an oracle form having data block tbl_address with base table name tbl_address. In the form there are two list: one(list_state) for State_Name & State_ID and another(list_city) for City Name & C_ID display.
    Here I want when I set State_name to ASD then List item list_city should be populated with the values having State_NAME=ASD not of State_Name=XY or None.I have tried it to make but not succeeded.I have made a procedure to populate list_city list item as:
    -- here item_nm-->List item Name,  sel_val & sel_val2 for selecting C_ID and C_NAME,   tablNm---->tbl_CITY,  whr for where condition,   mtch--->selected value of list_State(list item in form)
    PROCEDURE list_item(block_nm varchar2,item_nm varchar2,sel_val varchar2,sel_val2 varchar2,tablNm varchar2,whr varchar2,mtch varchar2) IS
    group_id RecordGroup;
    group_name varchar2(10) :='abc';
    status NUMBER;
    query1 varchar2(350);
    item_name varchar2(20);
    match varchar2(50);
    BEGIN
        match:=mtch;
        item_name:=block_nm||'.'||item_nm;
      group_id := find_group(group_name);
    if not id_null(group_id) then
    delete_group(group_id);
    end if;
    --if whr='' then
    --    match:='0';
    --    end if;
    query1:='select '|| sel_val || ',TO_CHAR('|| sel_val2 || ') from '|| tablNm ||' where '||whr||' = '||mtch;
    message(query1);
    group_id := Create_Group_From_Query(group_name,query1);
    /* Select statement must have two column*/
    status := Populate_Group(group_id);
    Populate_List(item_name,group_id);
    exception
        when others then
        message('error');
    END;
    I am not  able to guess what trigger  in oracle forms should be used to populate list item(list_city). Please help by giving useful suggestion.
    Thank You
    regards
    aaditya

    979801 wrote:
    If I use LOV in place of List Item,Then I have to populate a LOV at run time.How could I maintain a record group n attach to LOV at run time?
    On my previous post I have mentioned record group as follows:
    select * from tbl_state where s_id=:tbl_address.s_id;
    If :tbl_adress.s_id chaned during the time of run, then output values of list_city (LOV) is also changed.

  • List items problems in oracle forms 6i

    Hello friends,
    I am using list item in oracle forms 6i and facing one problem. I am populating list using following built-in.
    Clear_list()
    Create_Group_From_Query( )
    Populate_list()
    The problem I am facing is when list gets populate it keep the cursor at last element of list with null value. I want cursor to go at first item in the list. Is this thing is possible. The list item I am using is pop-list. In combo its showing list perfectly but I have to use pop-list only. Please help to come out of this problem.
    Thanks in advance
    Shweta.

    I have a question related to this post...what if you want the first item on the list to be the null record - but have it at the top of the list - like all other drop downs I've seen? I'm running on forms 9i
    Edited by: saburo on Mar 2, 2010 7:58 AM

  • How to populate multiple list items dynamically?

    Dear members,
    I have a form there are 3 list items i want to populate these from a record group by dynamically.
    but i can be able to populate only one list item. the others give errors.
    frm-41337 cannot populate the list from record group.
    following is the program unit:
    PROCEDURE POPULATE_LIST_WITH_QUERY
         (p_list_item in varchar2,
         p_query in varchar2)
    IS
         cst_rg_name constant varchar2(30) :=
              GET_ITEM_PROPERTY(p_list_item,item_name);
         v_rg_id RECORDGROUP;
    BEGIN
         v_rg_id := FIND_GROUP(cst_rg_name);
         if id_null(v_rg_id) then
              v_rg_id := create_group_from_query(cst_rg_name, p_query);
         end if;
         if populate_group(v_rg_id) =0 then
              populate_list(p_list_item, v_rg_id);
              copy(get_list_element_value(p_list_item,1),p_list_item);
         end if;
    END;
    i call this in the when-create-record
    populate_list_with_query('gl_users.location_id',
    'select location_name, to_char(location_id) from gl_locations');
    populate_list_with_query('gl_users.company_id',
    'select company_name, to_char(company_id) from gl_company');
    populate_list_with_query('gl_users.group_id',
    'select group_name, to_char(group_id) from gl_user_groups');
    only one is populated others give errors.
    what is wrong?
    thanks
    Muhammad Nadeem
    Oracle Programmer
    CHIMERA
    Lahore
    0092-0301-8334434

    Hi again,
    Did the popup work ?
    For the list item , use the built-in add_list_element in a loop. Example : in the pre-form or when-new-form-instance trigger ,
    clear_list('block_name.list_item_name');
    for rec in (select column1,column2 from t_table order by 1 desc) loop
    ADD_LIST_ELEMENT('block_name.list_item_name', 1, rec.column1, rec.column2);
    end loop;
    See you

  • Can we create a list item as a data block item?

    Hi,
    I have changed a text item to list item on the data block.
    This list item used to get populated when it was control block item, but after i changed it to data block item, it's not getting populated.
    My question is, can we create a list item(poplist) as a data block item?
    Any idea?
    Thanks in advance
    R.G

    Hi
    When you use ctl blocks data dose not fetch from Database. But in data blocks it get fetches when you execute query. So you have to make sure table column values are matching with the List Box values you have given.
    So please check table values.
    Nilaksha.

Maybe you are looking for