Dynamic LOV problem

I have an application where a person gets an ID code and then fills out many questionnaires, which I'm building using Portal forms. I have a table that tracks what questionnaire has been filled out by filling in a field of the data the questionnaire was completed, e.g.:
ID Q1Date Q2Date Q3Date Q4Date.......Q99Date
I'd like to use a dynamic LOV for the ID field, so that instead of typing in the ID, the person can just pick their ID from a list. I could build LOVs based on a select statement like this:
select id from idtable
where Q1Date is null;
But that's a lot of LOVs because I have 99 questionnaires (or it just seems like it). I tried getting around this by putting in a field on the questionnaire table that
contains the name of the association field from idtable; so that Questionnaire1 has a field "form" that contains the value 'Q1Date'. Then I built an LOV called LOV_ID based on this select statement:
select id from idtable
where :l_form is null;
Then, in the form wizard, for the ID field, I selected Combobox for the ID field, picked LOV_ID for the LOV, and picked the field "form" in the "pick the bindings for the bind variable" area.
The problem is that the LOV doesn't refresh when a questionnaire is entered; if you enter one for ID1, for example, the LOV still shows ID1.
Is what I want to do even possible? If so, what am I missing in building this LOV?
Thanks much for any help, even telling me "give it up", helen

Hi Helen,
I understood that you have two LOVs, based on SQL queries of two tables.
One of them depends on the other, which means that it contains a bind variable, which in the form is bound to the value of the other one.
Using this construct, the portal forms editor automatically sets up the event handler 'onChange' of the 'Master' LOV to refresh the page when a specific value is selected. You can see this in the editor in the last section of the form field's property page.
During the refresh, the value of the 'Master' LOV is passed to the bind variable of the 'Detail' LOV, so that in your case I think it then displays a subset of result data enclosed by the WHERE condition.
Did I get this right so far? Is your problem that the 'Detail' field doesn't refresh on Change of the 'Master'? In that case I would quickly try to build the form again, because that should definitely work.
I have used this mechanism shortly in an application i built, and it worked perfectly for me.
For the use of JavaScript (or more precisely Microsoft JScript) i can recommend using Microsoft's Library at http://www.msdn.com . The 'Web Development' part contains a complete and detailed reference on all HTML elements and their properties, plus the Internet Explorer's JavaScript DOM.
Hope to read from you soon,
Felix

Similar Messages

  • Dynamic LOV problem in Master Detail form in 3.0

    I am using Master detail layout for my app, In detail there is a LOV depending on the value of one of the items in master.
    LOV statement is like this
    select col1 a,col1 2
    from test_tab
    where col2 = :P2_VAL ;
    Note: :P2_VAL is the value of the one of the master table column value
    This code is working fine in version 2.1 .
    After I Upgraded to 3.0 , it is not working .
    If I put the hardcoded value like col2 = 'TEST' , it works for those values. Any suggestions for this problem is greatly appreciated.

    I solved it by commenting the Go_Item(startitm); line in the clear_all_records program unit which is generated by oracle forms.
    as shown below.
    IF :System.Cursor_Item <> startitm THEN
    --Go_Item(startitm);
    Check_Package_Failure;
    END IF;

  • Problem with dynamic LOV and function

    Hello all!
    I'm having a problem with a dynamic lov in APEX 3.0.1.00.08. Hope you can help me!
    I have Report and Form application. On the Form page i have a Page Item (Popup Key LOV (Displays description, returns key value)).
    When i submit the sql code in the 'List of vaules defention' box. I get the following message;
    1 error has occurred
    LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
    When i excecute the code below in TOAD or in the SQL Workshop it returns the values i want to see. But somehow APEX doesn't like the sql....
    SELECT REC_OMSCHRIJVING d, REC_DNS_ID r FROM
    TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
    returns_dns_lov_fn is a function, code is below;
    CREATE OR REPLACE FUNCTION DRSSYS.return_dns_lov_fn (p2_dns_id number)
    RETURN dns_table_type
    AS
    v_data dns_table_type := dns_table_type ();
    BEGIN
    IF p2_dns_id = 2
    THEN
    FOR c IN (SELECT dns_id dns, omschrijving oms
    FROM d_status dst
    WHERE dst.dns_id IN (8, 10))
    LOOP
    v_data.EXTEND;
    v_data (v_data.COUNT) := dns_rectype (c.dns, c.oms);
    END LOOP;
    RETURN v_data;
    END IF;
    END;
    and the types;
    CREATE OR REPLACE TYPE DRSSYS.dns_rectype AS OBJECT (rec_dns_id NUMBER, rec_omschrijving VARCHAR2(255));
    CREATE OR REPLACE TYPE DRSSYS.dns_table_type AS TABLE OF dns_rectype;
    I tried some things i found on this forum, but they didn't work as well;
    SELECT REC_OMSCHRIJVING display_value, REC_DNS_ID result_display FROM
    TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
    SELECT REC_OMSCHRIJVING display_value d, REC_DNS_ID result_display r FROM
    TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
    SELECT a.REC_OMSCHRIJVING display_value, a.REC_DNS_ID result_display FROM
    TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) a order by 1
    Edited by: rajan.arkenbout on 8-mei-2009 14:41
    Edited by: rajan.arkenbout on 8-mei-2009 14:51

    I just had the same problem when I used a function in a where clause.
    I have a function that checks if the current user has acces or not (returning varchar 'Y' or 'N').
    In where clause I have this:
    where myFunction(:user, somePK) = 'Y'
    It seems that when APEX checked if my query was valid, my function triggered and exception.
    As Varad pointed out, check for exception that could be triggered by a null 'p2_dns_id'
    Hope that helped you out.
    Max

  • Problem in getting dynamic LOV

    hi i am trying to acheive dynamic LOV.
    i followed the steps
    1.created a static record group
    2.created a LOV and assigned with the above created static record group.
    3.in w-n-b-i trying to create the DRG
    DECLARE
       rg_id    RECORDGROUP;
       grp_col  GROUPCOLUMN;
       rg_name  VARCHAR2(25) := 'RG_NAME';
       col_name VARCHAR2(25) := 'TYPE';
       lov_id   LOV;
    BEGIN
       /* Check if the RG already exists */
       rg_id := Find_Group(rg_name);
       IF ( NOT Id_Null(rg_id) ) THEN
          Delete_Group(rg_id);
       END IF;
       /* Create instance of DRG */
       rg_id := Create_Group(rg_name);
       grp_col := Add_Group_Column(rg_id, col_name, CHAR_COLUMN, 8);
       /* Assign the DRG to the LOV */
    lov_id := Find_Lov('TYPE_LOV');
       Set_Lov_Property(lov_id, GROUP_NAME, rg_name);
    END;4.in w-v-i of type
    DECLARE
       rg_id   RECORDGROUP;
       grp_col   GROUPCOLUMN;
       tmp_gc  GROUPCOLUMN;
       rg_name   VARCHAR2(25) := 'RG_TYPE';
       col_name   VARCHAR2(25) := rg_name||'.'||'TYPE';
       n_dummy1  NUMBER;
       n_dummy2  NUMBER;
       curr_rec   INTEGER;
       err_code  NUMBER;
    BEGIN
       curr_rec := Get_Block_Property(Name_In('SYSTEM.TRIGGER_BLOCK'), CURRENT_RECORD);
       rg_id := Find_Group(rg_name);
       grp_col := Find_Column(col_name);
       /* Add the value to the DRG */
       -- Add row first./*
       Add_Group_Row(rg_id, END_OF_GROUP);
       -- Now add the value.
       Set_Group_Number_Cell(grp_col, curr_rec, To_Number(:BMM_DESC));
       /* Verify the value was added */
       n_dummy1 := Get_Group_Row_Count(rg_name);
       tmp_gc := Find_Column(col_name);
       FOR j IN 1..n_dummy1 LOOP
          n_dummy2 := Get_Group_Number_Cell(tmp_gc, j);
          IF ( nvl(n_dummy2, 9999999999) = 9999999999 ) THEN
             Clear_Message;
             Message('Add Failed');
             Message('Add Failed');
          ELSE
             err_code := Populate_Group(rg_id);
             Clear_Message;
             Message('Add Successful');
          END IF;
       END LOOP;
          MESSAGE('FIRING');MESSAGE('FIRING');
    END;the problem is the lov is not appearing at all(previously the lov was appearing along with the static value assigned)
    when i tried to add value to the item(type), i am getting the following error:
    FRM-40735 WHEN-VALIDATE-ITEM trigger raised unhandled exception ora-06502
    i am getting pop up message-error in adding group row
    i have not done this before. in the help of some contents which is present in the fourm, i have tried it.
    where i am missing?
    Please help

    there seems to be problem with the item type, varchar2 or numeric whatever. check that.

  • Problem - Creating a Dynamic LOV using duplicate value in select statement

    I am trying to create a Dynamic LOV by attempting to follow a pattern similar to the following:
    select shop_name d, shop_id r
    from shops
    order by 1
    However, I want to use the shop_name twice as in the following because I do not have any other unique identifier available such as a shop_id to associate with the shop name:
    select shop_name d, shop_name r
    from shops
    order by 1
    But I get an error where I am not allowed to duplicate the shop_name in the select statement. I read somewhere on this forum where it can be done but I can't find exactly how.
    Can someone tell or show me how to accomplish this?
    Thanks in anticipation for your answer.
    Thanks,
    Ric

    Ric,
    I just tried to do this on APEX 3.0, and it worked just fine with this SQL:
    select ename d, ename r from emp order by 1Perhaps you could put an example on apex.oracle.com or specify the error message that you're getting.
    So as long as you have uniquely aliased both columns, this should not present a problem.
    Thanks,
    - Scott -

  • Dynamic LOV refresh problems

    I have a project site LOV that is set up to only show the sites relating to a particular client. The client is a dynamic LOV as well. Once the Client has been selected and the page/region refreshes the sites LOV should have the possible choices for the client showing. The code is fine as it has worked and I have got it working again but I had to change a lot of settings in the item linked to the LOV. I have a couple duplicate development apps that both work but the settings in the items are different. My question is what is the correct setting?
    Sorry if the post seems confusing.
    cheers
    Ian

    Hello
    If I understand your problem well, you are using a form based on a database table. The way it works is this: everytime the page is displayed, the database values corresponding to the record being displayed are fetched from the database (this is the setting "always - replacing any value in the session state"). This is correct as you want the page to display the most up-to-date information from the DB.
    Hence, when you submit the page in order to refresh the second LOV, that rule applies and you lose the value you just changed in the client field and things get messed up.
    Do you have this problem creating a new record or updating an existing one? I think this could work if you are creating a new record, as there is no DB values to overwrite the local values, but I am not sure if this can work if you are updating a record.
    Usually people use a "ajax" LOV refresh so the page does not need to be submitted.
    I hope this makes sense...
    Luis

  • Problem in Dynamic LOV query

    Hi,
    I have a LOV in my page its query should be based on item condition.
    So I tried using Apex provided Dynamic LOV Query with IF.. ELSE.. END IF condition.. But when I use this and run the page it is giving error "URL NOT FOUND".
    My query is
       IF :MY_ITEM is not null THEN
       RETURN 'select ename ,eno
                    from emp
                    where eno = '''||:MY_ITEM||''' ';
       ELSE
        RETURN 'select ename ,eno
                    from emp
                    where ename = ''ALAKA''  ';
       END IF;But it is not working for me.
    Please anyone help me to solve this.
    Thanks
    Alaka

    Hi All,
    It worked for me. Just I modified my code a bit. Thanks to all for help.
    Just I did ,
       DECLARE
       BEGIN
             IF :MY_ITEM IS NOT NULL THEN
                RETURN 'SELECT ENAME,ENO
                            FROM EMP
                            WHERE ENAME = '''||:MY_ITEM||''' ';
           ELSE
               RETURN 'SELECT ENAME,ENO
                            FROM EMP
                            WHERE ENAME = ''ALAKA'' ';
          END IF;
          EXCEPTION
            WHEN OTHERS THEN
                HTP.PRN('ERROR'||SQLERRM);
       END;
    Thanks
    Alaka

  • Problem with a Display Only field based on a dynamic LOV

    I have a field/item which is based on a dynamic LOV:
    select DESCRIPTION display_value, STATUSID return_value
    from CTCXFRREQS_STATUS_LOV
    order by 1
    ...and I need it to be display-only on the page. However, if I make it a display-only field, the return value is displayed, not the display value. If I change it to be a select list field, the display value is shown, as I expect and need.
    The field was based on a static LOV before, and it worked perfectly then.
    Has anyone seen this before, and have any suggestions on how to work around it?

    Hi,
    In edit item
    Display As: Display Only
    Save Session State: Yes
    Based On: Display Value of List of Values
    Named LOV: YOUR_LOV
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • Item Selection on a dynamic LOV (SQL Query)

    Hi,
    I've a dynamic LOV with an SQL query who return a list of data (one column). When i select a data in this LOV to be use as an item (sql query) in the same page the data is always null. In debug mode substitution string is null.
    FYI : when the data is selected, a button is clik to perform an sql query for a report in another page.
    Thanks. Sorry Abasolute beginner
    Message was edited by:
    user581765

    Thanks for Your help.
    The date is in fact a CHAR display (not really a date) so that is not the error.
    For your information when i select a row in the list (format char YYYYMMDD_HHMM) it seems that Apex do not catch my select in the Session state.
    I've change the item name with P2_DATE_FLOW but the problem remain.
    This is the debug log if can help
    0.03: Application 114, Authentication: CUSTOM2, Page Template: 3644802034190382
    0.06: ...Session ID 1868105032215374 can be used
    0.06: ...Application session: 1868105032215374, user=Neop
    0.06: ...Determine if user "Neop" workspace "2859608277950243" can develop application "114" in workspace "2859608277950243"
    0.06: Session: Fetch session header information
    0.06: ...Metadata: Fetch page attributes for application 114, page 3
    0.06: Fetch session state from database
    0.06: Branch point: BEFORE_HEADER
    0.06: Fetch application meta data
    0.08: Computation point: BEFORE_HEADER
    0.08: Processing point: BEFORE_HEADER
    0.08: Show page template header
    0.08: Computation point: AFTER_HEADER
    0.08: Processing point: AFTER_HEADER
    0.08: Computation point: BEFORE_BOX_BODY
    0.08: Processing point: BEFORE_BOX_BODY
    0.08: Region: Report 1
    Report 1
    0.08: show report
    0.09: determine column headings
    0.09: parse query as: CFM_MDRE
    0.12: binding: ":P2_DATE_FLOW"="P2_DATE_FLOW" value="0"
    0.14: print column headings
    0.14: rows loop: 15 row(s)
    No data found.

  • Error in Dynamic LOV with Bind Variable

    Hi
    I created 2 Dynamic LOV's in which Second one is with a Bind Variable.Then I creted a Form and Attached the LOV's to the form fields.But I am getting the below mentioned error when i choose a value in the First LOV and the Second LOV is not Populated. I tried the same thing with the scott.dept and scott.emp table which is working fine.but when i try the same on my tables it is throwing me error.
    Can Anyone Suggest me what is the problem of these LOVs
    FYI
    1)I am writing SELECT on Views in the LOVs and the views are created on tables of a different of database.
    2)Below Mentioned LINK_TIT is my DB Link.
    Error Message:
    An unexpected error occurred: ORA-01722: invalid number
    ORA-02063: preceding line from LINK_TIT (WWV-16016)
    Error displaying form : ORA-01722: invalid number
    ORA-02063: preceding line from LINK_TIT (WWV-16408)
    Error displaying block : ORA-01722: invalid number
    ORA-02063: preceding line from LINK_TIT (WWV-16406)
    Error displaying item : ORA-01722: invalid number
    ORA-02063: preceding line from LINK_TIT (WWV-16404)
    Error ORA-01722: invalid number
    ORA-02063: preceding line from LINK_TIT, displaying DUMMY_FRM_BLEND.DEFAULT.SKU5ID.01, combobox (WWV-16405)
    The preference path does not exist: ORACLE.WEBVIEW.PARAMETERS.16172911255 (WWC-51000)

    Hi Everyone,
    This was a known Issue in Oracle 9i AS Portal.I referred to the
    metalink note ID 174116.1 which talks about the BUG No:1584284.and it gives some workaround to come across the BUG.
    I got my dependent LOV work after changing the NUMBER datatype in the Procedure to VARCHAR2.(Then in the PL i converted the character to number by the SQL function.)
    Regds
    Rajesh Kanna.V

  • Dynamic lov, Select List in Report

    Hi all,
    I have searched the APEX forum for dynamic lov but somehow no topic could really solve my problem.
    I have a report and 2 columns in this report are displayed as a select list. I want one of the select list show some values depending on the other select list in this report. If the value of the first select list is equal to some data the second select list should show a lov and otherwise nothing.
    All examples i have found so far seem to explain a solution for a select list item on the page and not for a select list in a report like in my case.
    Are there any advices or some links you can give?
    Thanks in advance
    Markus

    See http://htmldb.oracle.com/pls/otn/f?p=18326:54:1415328128204513::::P54_ID:1282
    and http://forums.oracle.com/forums/thread.jspa?messageID=1222153&#1222153

  • Dynamic LOV with dates and selected default value

    Hello,
    I have a dynamic lov with dates. Query looks like this:
    select distinct concat(to_char(b.send_day_time,'YYYY.MM.DD HH24'),':00') display_value, to_char(b.send_day_time,'YYYY.MM.DD HH24') return_value
    from ...
    No I want to select a specific date as the default value. I put the following code for the default value:
    declare
    begin
    return to_char ('2008.02.19 10:00');
    end;
    But it doesn't work.The date (string) exists in the lov but it is not selected.
    Can someone tell me where the problem is?
    Thx in advance.
    Greetings,
    hamburger

    Hi hamburger,
    As return value you specified to_char(b.send_day_time,'YYYY.MM.DD HH24'),
    so your default value should be like to_char('2008.02.19 10'). Also pay attention to select the "Default Value Type".
    Hope this helps.
    chrissy

  • LOV problem ... returning display-value and not key-value

    Hi. Sorry for my broken English.
    I have a problem with pop-up dynamic LOV.
    I have a simple form called Form A containing item_code and item_name. Users can create, update and delete new item by using this form.
    Another form called Form B has a field called item_code, and the item_code field is a dynamic pop-up LOV field and a query for this LOV is like this;
    select item_name d, item_code r from item_master order by item_code;
    When i create the new record in Form B and use LOV to find and get the item code, LOV works fine
    and it returns key-value to the item_code field.
    But when i try to update the record (I have a link from report page to Form B), value of the item_code field is not the key-value from LOV, but is a
    display-value from LOV.
    Any ideas?
    Thank you.

    Well, from what you have described, this is working exactly as it should. Form B's LOV is intended to retrun the key value but should show the dispaly value. When you go from the report to the form, the key value is being passed (or should be depending on your code) and Form B ought to show the display value.
    So, in short, I would say that Apex is doing what it should. Unless I misunderstand something.
    Bruce

  • Where can i find the utility source of  "Dynamic LOVs" White Paper ?

    I downloaded this white paper :-
    http://www.oracle.com/technology/products/forms/pdf/10g/community_paper_generic_lov.pdf
    and its title is :
    Oracle Forms 10g – Dynamic LOVs
    The problem here is that I can't find the The utility source :-
    • COLORS.PLL
    • LOV.PLL
    • GEN_LOV.FMB
    • INIT_LOV.FMB
    • TEST_LOV.FMB
    does anyone have any idea where can i find the Source ?!
    please i want specific link , not like that exist in the white paper :-
    {The utility sources can be downloaded from the Oracle Technology Network (OTN1).}

    Francois Degrelle wrote:
    On the same page .........Despite fact that I don't know what page you are talking about - because the pdf file that I was talking about I downloaded it directly from Google - but I'm really grateful very much for you Francois.

  • Read only item populated by dynamic LOV

    Since I'm using artificial keys in most of my table FKs, I need to use a lot of LOVs to provide the user with discernible data.
    Many of the columns I use an LOV for I need to be read only items. However, whenever I use a dynamic LOV, I do not see how to make it read only. It sets the value of the item to [].
    I know this can be accomplished in some cases with a join in the underlying query. However, many of the pages where I need to make this change are not based on a query.
    Is there a way to make an item populated by an LOV read only while still retaining the value?
    Thanks for your help!
    -Reid

    I'm using apex 3.2.1. Your testing and replies have helped me realize that the problem is that the column indeed did not have a value. When I had the item "display as" set to "select list" the LOV was also setup for allow NULL=NO. Thus, it was showing some value in the LOV in that item. But, when I switched to the "display as text" and set the always read only, then it gave the double brackets []. When I changed the allow NULL=YES, it worked fine and gave me a blank value.
    Thanks again!
    -Reid

Maybe you are looking for

  • How do I access money in my iTunes account

    I can't access money I have in my iTunes account to pay for apps, songs, books. How do I redeem ?

  • File concatenating program does not work

    Hello, im quite new to java therefore it may only be a simple solution. The program reads mulitple files off the command line and then should join them up (concatenate) in a new file called "NewFile". The problem is it only prints the content of one

  • Still major problem with packages

    Here is my record Saved in C:/database/record/record.java package database.record; public class Record      {                                               //Data mebers           public int idNumber;             // Key field identifying each product

  • Invalid Username and Password on 10.7 SMB shares

    Getting "Invalid Username and Password" message when connecting to SMB shares hosted off a Mac OS 10.7 Lion machine from Snow Leopard or other OSes?  Even though you know you are using the correct username and password?  With the new SMB in OS X 10.7

  • BBPGETVD - All backend descriptions are already assigned in the system

    Hi together, My target I'd like to replicate vendors from R/3 with the same vendor numbers to the organizational structure of SRM. I execute the transaction: BBPGETVD. Settings: System: TERCLNT303 (defined Backendsystem) Supplier: 4100000005 Object I