Referencing Display_Value in LOV

Hi All,
I'm hoping this is an easy question, but I have searched and have yet to come up with a solution. I have created a dynamic LOV to select criteria for a report. I need to use the return value for the sql query, but also want to use the display value in the report itself.
Is there any way to reference the Display Value of a dynamic LOV in a SQL statement?
Any help would be greatly appreciated, thanks!
-Jon

Hi Paul,
Thanks for the quick reply. I actually want to use the display value as part of the Report Title. So for example.
The LOV would have a display value of John, and return value of 1001. I need 1001 for my sql query, and I want to grab the display value "John" to use in the report header something like: June Sales numbers for "John"
I figured out a workaround to use a decode function to pull the value and push it into a hidden field, I was just hoping there was an easy way to reference the display value of a LOV directly.
Thanks again,
-Jon
Edited by: 863579 on Jun 3, 2011 5:31 PM

Similar Messages

  • Personalizing LOVs in Create Timecard

    Hello,
    i have to personalize the "Create Timecard" page in "Self Service Time and Expenses" under Apps 11.5.10.
    If I choose the "Personalize page" link, in the personalized I find the following structure:
    Page Layout: Time Entry >
    Stack Layout: Recent Timecards >
    Stack Layout: Timecard Container >
    Table Layout: Required Field
    I have to make my changes at this level, but I can't find the items I must modify. I[b] have to Personalize Project, Task, Type LOVs, but I don't find them in the Personalization Structure!!!) How to Personalize these items ?.
    I've also gone through metalink document 304340.1 but not find anything regarding how to Personalize LOVs functionally.
    Can you help me, please?
    Thanks a lot.

    Time and Labor (OTL) has it's own method of configuring the timecard layout - have a look at the documentation on the OTL layout configuration. You can create as many Timecard layouts as you want, but when we did this it involved using FNDLOAD to dump an existing layout, modifying the ldt file and then loading up the new layout with FNDLOAD. Who gets which Timecard Layout is driven off the OTL Preferences, which would be why you saw different Create Timecard pages for different users.
    We haven't done exactly what you are trying to do, but we have created a custom LOV and to get that called from the Create Timecard screen we need to create a custom Timecard layout that referenced the custom LOV and then update the preference groups to use the new custom Timecard layout.
    Having said that, the content of the LOVs are not driven off the Timecard layouts (but how they are called is) - they are just OAF regions as far as I know. I thought that we had used personalisation on one of the standard LOVs to reorder columns, but that was back on 11.5.9, so I don't know whether the 11.5.10 changes in personalisation have affected that.

  • How to use list_item to trigger LOV

    This is for an assignment building a hotel reservation system
    Basically I have a list_item, with a variety of elements. I want to be able to select the list_item, choose one of the elements and have it launch an LOV. The user chooses from the list_item (r_type) a value such as "Single with Double Bed". As soon as the user selects this I wanted an LOV to pop up with the available room numbers of that type.
    I am using a trigger of WHEN-LIST-CHANGED:
    GO_ITEM('CUSTOMER_BLOCK.R_TYPE_LIST');
    LIST_VALUES;
    When I try this, and run the form, and try changing the drop down list it gives me FRM-41026: Field does not understand operation.
    I've searched google all I can and can't seem to find instructions on linking a list_item to a LOV in this way.
    Help appreciated, thanks.

    Presumably you have an item for the room numbers ? You ought to attach the LOV to that item and the W-L-C should go_item to the room number before launching the LOV. The
    value of the list item can be referenced in the LOV where clause.

  • LOV with subselect shows return_value instead of display_value

    Hi,
    I have the following dynamic SQL based LOV with a union in it that does not display correctly in the application.
    SELECT role_name d, role_seq r
    FROM apex_app_roles ar
    WHERE security_level = 1
    AND :F2500_APP_USER in
    (SELECT au.user_id FROM
    apex_app_user au,
    apex_app_user_roles auar
    WHERE ar.role_seq = auar.role_seq
    AND auar.user_seq = au.user_seq)
    UNION
    SELECT role_name d, role_seq r
    FROM APEX_APP_ROLES ar
    WHERE security_level = 0
    ORDER BY 1
    The problem I have is the first part of the SQL is displaying the return_value instead of the display_value. If I comment out the following the proper value is displayed in the application.
    AND :F2500_APP_USER in
    (SELECT au.user_id FROM
    apex_app_user au,
    apex_app_user_roles auar
    WHERE ar.role_seq = auar.role_seq
    AND auar.user_seq = au.user_seq)
    We currently have version 4.0.1.00.03 installed.
    Is there an issue with this version and what I am trying to do or is there something wrong with what I'm doing? The SQL returns the proper results if I run it in the SQL workshop so I'm at a loss here and if anyone can help it would be greatly appreciated.
    Thanks,
    Bruce

    The value is correct. I can run the entire SQL in workshop using parameter substitutions and it returns all the values correctly. So running this
    SELECT role_name d, role_seq r
    FROM apex_app_roles ar
    WHERE security_level = 1
    AND :F2500_APP_USER in
    (SELECT au.user_id FROM
    apex_app_user au,
    apex_app_user_roles auar
    WHERE ar.role_seq = auar.role_seq
    AND auar.user_seq = au.user_seq)
    UNION
    SELECT role_name d, role_seq r
    FROM APEX_APP_ROLES ar
    WHERE security_level = 0
    ORDER BY 1
    returns all the rows and looks like this.
    D     R
    ACP_ADMIN     3
    READ_ONLY     2
    READ_WRITE_ALL     1
    SERVICE_DESK_ADMIN     4

  • LOV query with 2 columns in the display_value

    Hello,
    I need a LOV where 2 values let's say "First Name" and "Last Name" need to be combined into the display_value of this LOV.
    How can i do this?
    I have already tried the following but this doesn't seem to work:
    select FName & " " & LName display_value, PersonId return_value
    from tbl_Persons
    order by 1
    Thanks in advance,
    Bram.

    Use the ||..
    select FName ||' '|| LName display_value, PersonId return_value
    from tbl_Persons
    order by 1

  • Popup Lov referencing page item Problem

    Hi,
    I try to display a list in a popup lov item. This item references an another item in the page :
    select NOM d,EMAIL r from ACTEURS
    where ID_DOSSIER = :P16_ID_DOSSIER_PRINCIPAL
    If i make the id_dossier directly as a number, the popup works and display the list, but if i make the item :P16_ID_DOSSIER_PRINCIPAL it dos'nt work.
    Please help !
    Thanks

    User,
    Changes are there is a process that is resetting the session state for the page that has the item you're trying to reference. One suggestion would be to create a hidden item on the same page that you have the LOV item that referenced the item on the other page. Then make a page process on the "other" page that sets your new item with the value of the other item before session state is reset. Then just modify your query to reference your new item.
    If you put an example up on apex.oracle.com and provided the workspace/username/password (you can create a new user account for this) I'll take a closer look.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Referencing static LOV from plsql

    I have a number of static LOV's. How can I reference these in PL/SQL.
    For example, I am creating a report using PL/SQL so that I can create the exact layout I require. The data uses a number of list of values so I need to convert the value fields into the displays fields from the list of values using PL/SQL.
    How?

    Jezzer,
    It will depend on your version. If you are using 2.2 or 3.0, you could use the view APEX_APPLICATION_LOV_ENTRIES to access your lov values. It will automatically be limited to the workspace that your schema is associated with and then you can further qualify with the APPLICATION_ID and LIST_OF_VALUES_NAME. To see the view, navigate to Utilities > Application Express Views and query on lov.
    -- Sharon

  • LOV referencing a LOV

    I have a report which displays information on a cities.
    I would like to be able to have the user select country/state/city in the customization screen using LOV's. This means the State LOV would need to change as a result of the Country LOV and likewise the City LOV would have to change as a result of the State LOV.
    I know how to do this on a Form, by refreshing the Form, but I haven't been able to do it in the customization Screen.
    Any ideas would be appreciated.
    Thanks, Larry

    Hi Larry,
    What you require can be done using an onchange trigger in the comboboxes and a Javascript array.
    Basically on change of the Country SELECT list, all of the OPTIONs are removed from the State and City SELECT lists and only the valid ones added.
    This will make for a large page, as it has to hold the entire list of Countries, States and Cities, plus the script to set them straight.
    The advantage to this method as opposed to using PL/SQL is that the form is not submitted and is therefore constant on the screen, and the user does not have to wait for so long when changing the SELECT lists.
    Regards Michael

  • Popup Key LOV, NULL and "Invalid numeric value undefined for column"

    Hello.
    I've created an item based on database column of NUMBER type and set the following properties:
    Display As = Popup Key LOV (Displays description, returns key value)
    List of values definition=select 'display_value' d, 1 r from dual
    Null display value=%
    Null return value=
    Display Null=Yes
    When I select "%" in the LOV and try to apply changes to database I get error:
    ORA-20001: Error in DML: p_rowid=1781, p_alt_rowid=N1, p_rowid2=, p_alt_rowid2=. ORA-20001: Invalid numeric value undefined for column N2
    Error Unable to process row of table TTT.
    If I set Display As = Select List, all works fine. But I need Popup Key LOV.
    Could anybody help me?
    I use Application Express 2.2.1.00.04

    Hi all,
    I did my homework and solved this issue. First I would like to thank Patrick Wolf for the invaluable help he gives out on thread Re: Null value handling in LOVs The code presented here is just a minor edit to his code, but an essential one when dealing with Popup Key LOV items.
    Here's what I did:
    1. Create an Application Process.
    Name: RemoveNulls
    Sequence: 0
    Point: On Submit: After Page Submission - Before Computations and Validations
    Process Text:
    BEGIN
        FOR rItem IN
          ( SELECT ITEM_NAME
              FROM APEX_APPLICATION_PAGE_ITEMS
             WHERE APPLICATION_ID   = TO_NUMBER(:APP_ID)
               AND PAGE_ID          IN (TO_NUMBER(:APP_PAGE_ID), 0)
               AND LOV_DISPLAY_NULL = 'Yes'
               AND LOV_DEFINITION   IS NOT NULL
               AND LOV_NULL_VALUE   IS NULL
        LOOP
            IF (V(rItem.ITEM_NAME) = '%null' || '%' OR V(rItem.ITEM_NAME) = 'undefined')
            THEN
                Apex_Util.set_session_state(rItem.ITEM_NAME, NULL);
            END IF;
        END LOOP;
    END;Error Message: #SQLERRM#Condition: None
    2. You should be able to submit a Popup Key LOV with a NULL value now.
    Once again, THANKS, Patrick! You rock! I'm seriously thinking of trying ApexLib now :)
    Georger

  • How to retrieve 2 values from a table in a LOV

    Hi
    I'm pretty new to APEX. I try to retrieve two values from a table using a LOV. I have a table named DEBIT with then columns SITE, NAME and KEY
    I want to display NAME to the user in a list. When the user select an item from the list, I want to retrieve the data of the SITE and KEY column of this item in order to launch an SQL command based on this two values.
    How to retrieve thes two values whant the user chooses an item from the list ?
    I apologize for my english, being french.
    Regards.
    Christian

    Christian,
    From what I understood about your requirement, you want a 'select list with submit' which displays "NAME" and based on the value selected, you want to get the corresponding values for "SITE" and "KEY" from the table.
    <b>Step 1: Create a select list with submit, say P1_MYSELECT </b><br><br>
    Use something like this in the dynamic list of values for the select list: <br>
    SELECT NAME display_value, NAME return_value
    FROM DEBIT<br><br>
    <b>Step 2: Create a page process of type PL/SQL block. Also create 2 hidden items P1_KEY and P1_SITE. </b><br><br>
    In the PL/sQL, write something like:
    DECLARE
      v_key DEBIT.KEY%TYPE;
      v_site DEBIT.SITE%TYPE;
      CURSOR v_cur_myvals IS
              SELECT KEY, SITE
              FROM DEBIT
              WHERE NAME = :P1_MYSELECT;
    BEGIN
      OPEN v_cur_myvals;
      LOOP
              FETCH v_cur_myvals
              INTO  v_key,v_site;
              EXIT WHEN v_cur_myvals%NOTFOUND;
    :P1_KEY := v_key;   
    :P1_SITE := v_site; 
      END LOOP;
      CLOSE v_cur_myvals;
    END; <br><br>
    Then you can use these values for whatever purpose you need to.
    Hope this helps.

  • How to create a multi column list item and select these values from a LOV

    Hi all,
    My requirements are:
    1) create an LOV which holds the productno, productname and productprice fields (this is working)
    2) at run time, select one record from LOV and populate the list/grid with this selected record values of productno, productname and productprice fields, so we are showing them on the form in the form of a table/grid (not working)
    3) be able to select multiple records from LOV and be able to populate the list item with multiple records (not working)
    4) have two more columns in the list/grid, for productquatity and total price (not wokring)
    Please help me.
    how can i create this grid or list in oracle
    whats the possible way of acheiving this in oracle

    If you use a list item to display multiple columns then you'll need to use a fixed-width font. You can achieve a similar look with proportional fonts by using a normal block and setting the fields' bevel to 'None'.
    Each column in the LOV has a Return Item property (under Column Mapping Properties). Set this to a :block.item reference for each column to bring the data back into those referenced fields.
    You can't select multiple records from an LOV. For this you will need to create your own form. Check the help for system.mouse_button_modifiers to see how to respond to Ctrl+click and Shift+click.
    To add columns just modify the LOV's record group's query.

  • 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

  • How to accessing current row report column value in Lov Query?

    Hi,
    which access methods (eg. bind variables, substitutions, ...) for getting the current row report column value can be used in the "Lov Query" property of a report column?
    As what I know of and what I have read on the forum there are no bind variables for the report columns. For the "Link Text" property it seems that the column values exist as substitution strings (#COLUMN_NAME#). But they don't work in the Lov Query. => And would be good because of a hard parse each time the Lov query is executed.
    The following post (Re: Simulating a correlated sub query in lov
    is showing a solution to use package variables for temporary storage of the referenced value, but the only problem with that solution is that if a new record is added with the "Add rows to tabular form" process the package variable still contains the value from the last queried row! Is there a way (variable, APEX package, ...) to determine if the lov query is executed for a new record so that the package can return null?
    I know that I could write the package in a way that the value is immediately cleared when lov_pkg.keyval is called (one time read), but then I would have to create several variables if I'm accessing the value multiple times in the query or in another query => I think an one time read solution would be very obscurely.
    Thanks for your help
    Patrick
    http://inside-apex.blogspot.com

    Hi Patrick,
    I agree that it's a waste to continually use Ajax to go back to the server to get the contents of a dynamic select list.
    There are no bind variables for any row item - but what you do have, as per my previous post, is the value of the data entered by the user in the first row. You can pass this into your application process (using get.add("VARIABLENAME", value)), which can use it to retrieve the correct LOV in your Ajax code - this will give you a "bind variable" that your process can use.
    What you could do, however, is generate hidden select lists on your page - one for each possible LOV list and replace the contents of the new row's select list with the contents of the appropriate hidden select list. This is easy to do with javascript (using innerHTML functions). Obviously, though, the usefulness of this depends on the number and size of the select lists.
    Even if you don't generate them to start with, you can keep a copy of any select lists returned by Ajax in the DOM for use on new rows. So, if you have retrieved a select list, you will have a copy of it in DOM which you can then copy into the new row. If you don't have the list in DOM, use Ajax to get it, store a copy of it and copy it into the new row.
    Which method you use will depend on the number/size of select lists needed. If they are few in number and/or size, I would suggest generating hidden lists. If they are large, use Ajax to get them once, store them and then retrieve them from the DOM when needed.
    There is another thread here where Arie recommends going to the server every time to make sure you get the most up-to-date data for the lists. If you want to follow this advice, for this reason, use get.add("VARIABLENAME", value) to pass the value to your process. If this is not an issue, you can use one of the other methods I outlined above.
    Regards
    Andy

  • Can you use iPhoto as your referenced library in Aperture 3?

    Hi folks, new to the forum here and I've searched around older posts for an answer to this dumb question but can't seem to find it. Any insight much appreciated.
    I'm a relatively new mac user, migrated over just under 5,000 photos from Photoshop Elements on the PC to iPhoto on my new iMac and very happy with it. I was going to get the new PSE for Mac to use as my editor with iPhoto, but now that Aperture 3 is such a ridiculously good price on the App store I've been testing that out and I love it!
    So the question is, as I start to get more serious about my photography I would love to be able to use Aperture for everything - but the rest of the family just want the simplicity and great interface of iPhoto for the family shots. Can I / we keep importing, storing photos in the iPhoto library, and everyone else just uses that for the cropping, red-eye removal etc., but I can access the library in Aperture (sort of like a referenced library) make changes, add versions etc. without messing it up?
    Hope that makes sense, and again, apologies for what must be the millionth time this question has been asked.
    James

    In a word, no.
    Aperture and iPhoto are entirely different applications that work in very different ways.
    The only communication between the two is as follows:
    Aperture is able to parse the iPhoto Library to allow it to import the contents while stacking the Originals and Modified versions, preserving metadata and so forth.
    Aperture can share its Previews with the iLife apps, including iPhoto.
    That's it.
    So, specifically, what interaction there is between the two is designed to facilitate migration from iPhoto to the more powerful app. After that, iPhoto has exactly the same relationship to the Aperture Library as, say, Pages or iMovie.
    Regards
    TD

  • Mandatory fields in a LOV

    I have a view in which I've added attributes from an entity to make a LOV. These attributes are mandatory in said entity. Foreign key in the view (and in an underlying entity) is not mandatory however (it can be null).
    When I drop this LOV column onto a page as an InputText with ListOfValues, resulting form field is required (and it will show an error if I leave it empty and try to submit the form). That is not what I expect. The entity referenced from a view is not updatable, the underlying entity is.
    How can I have an optional field with a LOV, not making referenced entity columns non-mandatory?

    Hi,
    Try after remove required attribute in your LOV
    required="#{bindings.YourField.hints.mandatory}"

Maybe you are looking for

  • Error in reading from excel file

    hi, I have written a program which reads from excel file and based on the value of the column i have to do something. Everything is fine but when i run it, it produces an error message Exception: For input string: "851.0" the value 851.0 is acually t

  • App for Windows 8 are really bad

    The apps Microsoft made for Skype are really bad. Any chance for a update so you have some chance of getting to things like call and chat and make it more clear who are online. Out of a lot of bad apps for windows 8 this take the cake!!

  • SQL Server Management Studio and Native Client different behaviour on delete

    I have a problem with transaction containing insert and delete to same table and some select/insert/update to some other tables. Problematic table has primary key defined as combination of column1 and column2. When two different instances using Nativ

  • Error using sender ws adapter

    Hi, I am getting the following error while using the WS adapter at the sender side. the SOAP response indicates that an error occurred: System Error <detail><s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0"><context></context><code>INTERNAL

  • Cancelling Rejected Items in DP90

    Hi SAP Gurus,      Is there an easy way to reverse/cancel items that have been rejected in RRB DP90 ?? Look forward to any help Ross