Set Default Value of Multi-select list item

I have a multi-select list item I want to default the value of to '%' (which is really '%null%') and have it selected. I tried setting default value of item, but it doesn't take '%null%'. I also tried a computation with a static of
:P507_ITEM := '%null%'; How do you get the default value set and selected?

Hi
Shijesh is right, you need to change your null return value and use that return value as your default. Try and use something of the same datatype as your real return values if you plan to use '%' to display all as it will make your queries simpler. eg.
Company A returns 1
Company B return 2
% returns 0
Then your query would be...
SELECT ...
FROM ...
WHERE company_id = DECODE(:P_COMPANY,1,1,2,2,0,company_id)
Hope this makes sense.
Cheers
Ben

Similar Messages

  • Select multiple values in mult-select list

    I have the following query as the source for a multi-select page item:
    SELECT person.person_id
    FROM person, pers_proj_task
    WHERE pers_proj_task.person_id = person.person_id
    AND pers_proj_task.project_id = :P3_PROJECT_ID
    The query returns two records and the page item's session value is 4:3, but only the value 4 is highlighted in the mulit-select list. How can I get both values to be highlighted?

    Got it to work for a multi-select item by following Dimitri's post which uses a shuttle example. It was still only highlighting one value, but I tried Patrick Wolf's suggestion from the comments on Dimitri's post to put the pl/sql block in the source of the item rather than as a computation and it worked.
    So I now have a multi-select list which has default values pulled from a LOV. The items that are highlighted by default are selected by using the following pl/sql block in the "source/value or expression" of the :P3_PERSON_ID multi-select item:
    declare
    person_list apex_application_global.vc_arr2;
    i number := 1;
    begin
    for r in ( SELECT person.person_id
    FROM person, pers_proj_task
    WHERE pers_proj_task.person_id = person.person_id
    AND pers_proj_task.project_id = :P3_PROJECT_ID)
    loop
    person_list(i) := r.person_id;
    i := i + 1;
    end loop;
    return APEX_UTIL.TABLE_TO_STRING(person_list,':');
    end;
    Thanks to Amanda, ArtS, Dimitri and Patrick.
    Jeremy

  • Setting current values in Multiple Select List in SQL Query based Report

    Hi,
    I have a report based on a sql query that contains a multiple select list. Unfortunately I cannot get the multiple select list to display the current values (p_value) correctly. I have created a page item, :p311_current_versions, that is set using a pre-header process and it returns a value with a colon delimited format e.g. '10.1.2.1.0:10.1.2.2.0'. Then this item is used in the sql query to set the current value (p_value) of the apex_item.select_list_from_query function. However when the table is displayed, instead of having two entries, 10.1.2.1.0 and 10.1.2.2.0 selected, it has an extra entry '10.1.2.1.0:10.1.2.2.0' selected.
    Here is my code:
    select distinct a.product, a.version from (
    select distinct
    apex_item.display_and_save(2,product)||apex_item.hidden(1,env_product_id) PRODUCT,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(3,decode(product, 'HTTP Server' , :p311_current_versions, version), 'SELECT distinct version d, version r FROM ebs_tech_stack where
    product ='''||PRODUCT||'''',
    decode(PRODUCT, 'HTTP Server' ,'multiple="multiple" style="width:170px"','style="width:170px"'),
    'NO') as version
    from ebs_environment_tech_stack
    where environment_id = :p311_umgebung_id) a order by a.product
    If anyone can help me figure out how to set the current values correctly I'd be really grateful!!
    Thanks in advance,
    Jean

    Jean,
    I don't think this is possible using the apex_item package. The select_list_from_query function accepts only a single value for the second parameter.
    Scott

  • How do you get the value of a selected list item?

    I have a drop-down list that the user can choose from. How do I get the value of what they selected? I thought I could do this by using the NAME_IN function, but I'm getting FRM-40105 Unable to resolve reference to item X. I don't know what I'm doing wrong.
    Thanks!

    Hi,
    You can use an WHEN-LIST-CHANGED trigger, attached to the list-item itself. And, in this trigger, you can use the name of the item to refer its value.
    For example:
    :block_name.list_item_name
    John

  • Multi Select List Item

    Hi All
    I want to have a field on my page that will be having around 80 values say Poplist.But i want to select multiple values.Like may be you would have seen some sites on which there is a field say Technologies you know and we select OAF,PLSQL etc..
    Thanks in Advance.

    Hi,
    You can use ListBox bean of OAF, you can not create it at design time so you need to create using controller, following is the sample code
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    // Create the list bean (be sure to give it a name).
    OADefaultListBean list =(OADefaultListBean)createWebBean(pageContext,
    OAWebBeanConstants.DEFAULT_LIST_BEAN,null, "positionsList");
    // Specify the view object that you will use to populate the list bean values.
    list.setListViewObjectDefinitionName("oracle.apps.fnd.framework.toolbox.poplist.server.PositionsVO");
    // Specify the display and internal value attributes in the associated viewobject.
    list.setListValueAttribute("LookupCode");
    list.setListDisplayAttribute("Meaning");
    // Configure the list box to allow selection of multiple values.
    list.setMultiple(true);
    // Even though you created the component with an ID, you must explicitly
    // make this call to setName().
    list.setName("posList");
    // In this example, we're adding the list box to a messageComponentLayoutregion, so we
    // get the declaratively defined messageLayout region that will contain this
    // component. Note that we declaratively set a prompt for the list box on the
    // messageLayout region.
    OAMessageLayoutBean listBoxLayout =(OAMessageLayoutBean)webBean.findChildRecursive("ListBoxLayout");
    listBoxLayout.addIndexedChild(list);
    To get the values selected from list box you can use following code in your PFR
    OADefaultListBean list =
    (OADefaultListBean)webBean.findChildRecursive("positionsList");
    String name = list.getName();
    String[] selectedValues = pageContext.getParameterValues(name);
    Regards,
    Reetesh Sharma

  • Can't Set Default Value for LOV Presentation DB Column

    I have a simple form. One of the fields is populated using a named, dynamic LOV with the following source query:
    SELECT USER_NAME DISPLAY_VALUE, USER_ID RETURN_VALUE
    FROM USER_ACCT
    ORDER BY 1
    I want the default user to be public, which is one of the possible values returned by the above query. However, I just can't find a good way to do this.
    If I put the following query in the Default section, nothing happens.
    SELECT USER_ID
    FROM USER_ACCT
    WHERE USER_NAME = 'PUBLIC'
    If I look up the ID and statically put the value in the Default, it works (This isn't acceptable . From environment to environment the value will differ)
    If I put the SQL in an after footer page process, it sets the value correctly in the session but, does not update the display.
    If I try to put it in the Post Calculation Computation section, it merely produces an error.
    I'm sure that I am missing something simple but, I have not spent an hour and half on this.
    Someone please help!
    -Joe

    A function I'd like to see is the ability to not only create a select list dynamically, but also set the default value of that select list's item to the first (or Nth?) value on that list. This could be specified in the builder by an item option.
    E.G., if a select list LOV returns three values: "foo", "bar", "baz", go ahead and set the value of the select list item to "foo".
    As far as I've been able to discover, there's no built-in way to do this in Application Express. I've looked through the app, the docs, and the forum. If such a method does exist, please let me know.
    Otherwise, we end up running additional processes that reissue the query so we can grab the first item as the default value. This seems inefficient to me.
    Keeping the LOV query and the "first item" query consistent can present problems as well. We usually end up pushing the LOV query into a function so it can be maintained in a single location, but this seems more like a workaround than anything else.
    While the query is probably cached, Application Express has that return value already, right? Why calculate/choose it again?

  • How to default a value in a select list

    Hi
    I have an item on the page which is displayed as a select list.
    The select list has an lov that returns 3 values as follows:
    ACAD1M
    ACAD2H
    ACAD3T
    the sql for this lov is as follows:
    select CAL_TYPE d,cal_type r
    from igs_ca_type
    where s_cal_cat='ACADEMIC'
    It needs to return the values in the order as shown above, however if the user does not select anything from the select list, I want it to default to the value in the middle of the list(ACAD2H)
    I tried using default on the item but I could not get this to work.
    Could someone explain how I can get the select list in HTMLDB to default to the value that I want regardless of which position it appears in the select list it always seems to default to the value at the top of the list.

    Hello Kay,
    A default value for a select list must be set to a legitimate returned value from the select list LOV query.
    The default value should be set in the item "Default" section. In the "Default Value" field you should enter your query – in a form of a PL/SQL Function Body – and set the "Default Value Type" field accordingly.
    The following is an example of code I'm using to set the default value of a select list to be the first displayed option (set by the user, and recorded in the dispord column):
    declare
      l_sno  number;
    begin
      select sno
      into l_sno
      from mis_mess_users
      where dispord = (select min(dispord)
                     from mis_mess_users);
      return l_sno;
    end;Using the same principle, you can use any query that will give you the result you need.
    Regards,
    Arie.

  • On button click of Infopath forms select multi select list box values...

    Hi,
    We have multi select list box on one of the info path forms. We have placed on button on this form. If user clicks on this button we want to select some of the values in Multi select list box (check box).
    Is it possible if yes how can we achieve it?
    Thanks.
    Regards,
    Amit Chhatbar

    Hi Amit,
    From your description, you would like to check items in a multi-selection box when a button is clicked.
    I’d recommend you make use of rules in InfoPath form, i.e. when button is clicked, then set a field’s value.
    However, if you are using multi-selection box, then you could only set the value of one item at a time. If you want to select several items at once, then we could use code. For more information:
    http://www.bizsupportonline.net/blog/2009/07/understanding-multiple-selection-list-box-infopath/
    http://www.bizsupportonline.net/infopath2007/programmatically-select-all-items-multi-select-list-box.htm
    If you are using several check boxes to replace multi-selection box, then it will be more easy. The rule could be that when this button is clicked, set a field’s value (check box field) to true and repeat it.
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • How to hide PNP selection windows and set default values for PNP.

    Hi expert,
         I am using HR logical database PNP, but I don't want to display selection windoes for running program on PNP, whereas I want to set default value for some selection items in the program. could you please tell me how to get those two targets?
    Many Thanks,

    Hi
    You have mentioned 2 things.
    1. Don't want selection windows for running program for PNP - this can be achieved using the HR Report category - You can get more details on HR Report Category on
    HR Report Category
    2.  I want to set default value for some selection items - This you need to achieve in initialization event of your program.
    How you can get this can be explained by INITIALIZATION (SAP Library - ABAP Programming (BC-ABA))
    Thanks,
    Sreeram

  • Pass values fromSharePoint list multi-selection list box to Infopath Multi-selection list box and back

    Design overview:
    List A
    InfoPath Library - Form A
    SharePoint Designer workflow
    List A has a multi-selection column with multi-values.
    Form A has fields populated from the data in List A by using a data connection in the form.  I have a workflow that updates the values or creates a new item in List A. All fields work except the mufti-selection. The multi-selection has ;# separating
    the values and I am having trouble setting the list box properly(checking of the selecting values) instead it concats all values on one line. I basically need to get the multi-selection column from list 1  to show exactly in the Form A and be able to
    update the selection with the workflow. I can do this with single values with no problem. the multi-selection list is difficult. I read somewhere I can use a repeating table but I am not sure the workflow will work with that. That is only a read and not 
    a write.

    Wow over my head a little. I understand what an array is with script but not how to write the script to handle it. I made this:
    event.value = getField("LISTBOX").value;
    But still no change in the behavior with multi selections. Example below if you want to check it out.
    https://dl.dropboxusercontent.com/u/2944617/formtext2.pdf

  • Process open items: how to set defaults for the additional selections

    Hi FI experts,
    Can anyone tell me if it is possible to set defaults for the additional selections in the processing of open items.
    I am using transaction F-04 (or F-06 or F-07) to post with clearing.
    When processing the open items I can use additional selection parameters. In my case I need to use the document type.  I would like to save this selection as a default but this doesn't seem to be possible.
    1. it is not possible to save a variant for the processing of open items
    2. I can not create a variant transaction (with trx. SHD0) for F-0x since this is only possible for dialog transactions
    Do you see another way to store defaults for the additional selections in open item processing?
    Thanks a lot.
    Dimitri

    Hi,
    When you create a transaction variant from FB05, then also you will not able to default the value for additional selections variable.  Hence SHD0 is not going to help.
    As said above, either you can change the additional selection screen parameters, but here again you can't default the value.  You can only reduce the number of entries on the screen.
    Else you can create a custom transaction code by copying the standard.  Even SAP recommends to create custom codes from standard tcode for clearing purposes depending on requirements. 
    Please check this link:
    http://help.sap.com/saphelp_erp60_sp/helpdata/EN/41/37b8e7455b11d182b40000e829fbfe/frameset.htm
    In the above link, in navigation choose clearing -- Specifications for processing open items
    If it is a custom transaction then you can default document number.
    Regards,
    Ravi

  • How to Set default value to dropdown list in oracle ADF

    hi,
    I need to set default value in the drop down list in oracle ADF.
    If you take in HTML :
    <select>
    <option value="">Select Value </option>
    <option value="saab">Saab</option>
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
    </select>
    Like this i need to set default value in drop down llist in oracle ADF.
    Thanks and Regards,
    M. Ramu.

    Hi Ramu,
    Please be more clear on ur post whts ur Jdev version and wht type of dropdown u r using model driven or static list..?????
    Its hard to help u without proper info..
    Just have a look into this before u post a thread...
    https://forums.oracle.com/forums/ann.jspa?annID=56
    Regards,
    Suganth.G

  • Setting default values for item in opportunity mgmt(crmd_bus2000111)

    Hi All,
    I need to set default values for the field Fiscal Quarter in item level using BADI CRM_CUSTOMER_I_BADI .This Field is created using EEW. The default value is like if the date is nov-2007 the value for this fiscal period is FQ4-2007 .
    Any clue would be great help..

    Why don't you try setting the default value in the List next to the Matrix - item 107
    Item 107 is a matrix (a transposed one), I have no idea what list you mean...  I am using item 107, not 112. Item 112 is used only to detect a click on the "Add Record" button, which is the last row of the matrix 112.
    I don't see the gender column in the grid and I'm also unsure of the id you have for it "12" - are you sure it's correct ( i usually use Item("columnName") )?
    Sorry for the confusion. "12" is the name of the standard column "Password" which we have renamed to store the gender.
    Anton

  • To set Default values for web items in WAD

    Hi Experts,
          I am designing the web templates. There, I placed some drop-down boxes. In that item, I would like to set default values.
          Usually in the drop-down box, 'show all values' is selected. Instead of displaying all values, the drop-down box should be set to the filter value.
           Pls give me the solution to sort out the problem....
    Yours,
    Yokesh.

    are you using 7.0 or 3.x?
    in 7.0 you can use the webcommands of the webTemplate.
    Use Dataprovider commands and there is an option for assigning a default value.
    To eliminate All Values, unchecked it for the dropdown box.
    hope it helps,
    have a nice day
    DavidG

  • Set Default Value  In list box

    Dear All,
                   I am using the F4IF_INT_TABLE_VALUE_REQUEST this FM for filling the list box .Now i want to set  default value in the list box
    Example-
    Supose i have 2 List box  A & B and in list box i have to set default value in A list box X value and in B list box Y value .
    X and Y value is coming in the list box from the master table .
    Thanks & Regards

    Code Snippet for your referance:
    *F4 Help for Output Type
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KSCHL
    DATA: l_repid TYPE syrepid,
            l_dynnr TYPE sydynnr.
      MOVE: sy-repid TO l_repid,
            sy-dynnr TO l_dynnr.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'KSCHL'
          dynpprog        = l_repid
          dynpnr          = l_dynnr
          dynprofield     = 'P_KSCHL'
          window_title    = text-001
          value_org       = 'S'
        TABLES
          value_tab       = it_value_tab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3

Maybe you are looking for

  • Why is this .vi slow ?

    I use this rather uncomplicated .vi for an one hour continuously monitoring displayed digitized signals thru the GPIB output of my Tektronix DSA 602 ( Digitizing Signal Analyzer, sampling up to 2 Gs/Sec ). If I tweak the Signal Analyzing Scope at its

  • How can i get FF to retain a username only?

    IE will retain my usernames for at least several days on one of my email account servers. FF does not. I only want it to give me an option to keep usernames, not passwords.

  • Having trouble downloading Java XML software

    I have been looking at urls related to http://technet.oracle.com/tech/xml/ and can't seem to find the following: 1. Java classes (and possibly source) for using in Java programs that utilize JDBC. This would be for stand-alone Java programs that you

  • Ignorant question: Where have my photos gone?

    Apologies if you think this has been covered previously but similar queries haven't answered my ignorant but basic question. I can't find where my photos are saved to in iPhoto 08 - in 06, the file structure is 1) visible to me and 2) arranged chrono

  • What is this Hour Glass Model and what is the best order of dimensions

    What is this Hour Glass Model and what is the best order of dimensions in Essbase cube (Block storage model)