Select MULTIPLE default values for a multiple selection list box based on another field in Infopath 2010

Hello there - Before I explain my issue, I would like to point out that I have reviewed some other discussions on selecting default values for multiple selection listbox. But my issue is specific and different, and not answered by any of the discussions
I visited.
I have a multiple selection list box (say for example all countries in the world as values), and I would like to pre-select or setup multiple default values (say five countries) based on some criteria that I query from MS SQL database table.
I know we can go to Data | Default Values option to setup one or many default values for multiple selection list box. When I enter the default values manually this works. I also right click the field under the Multiple-Selection List Box group, then select
Add another Value Below and set the Default Value for this field to setup multiple default values.
However, if I reference a field (either an infopath field or a field from SQL database) I am not able to setup multiple default values. Infopath automatically selects the last field I selected for all instances and in the end I am able to see only one
default value selected instead of many. How to fix this problem? Why would infopath allow multiple default values when we enter it manually but not when we reference some fields?
Please let me know if you need more info. Appreciate your help.
Thanks!

Hi redhotc,
According to your description, my understanding is that you want to set multiple default values for a multiple checkbox list in InfoPath form.
I did a test with SQL database table. I set three default values for the checkbox list by adding three values field under the group field(Data->Default values), each value field is for a default value. Then publish it to my SharePoint site, everything
was fine.Please have a try as the below link:
http://www.bizsupportonline.net/infopath2010/pre-select-items-multiple-selection-list-box-infopath-2010.htm
Note: if you are using SQL databse table, you may need to enable ‘Allow cross-domain data access for user form templates that use connection settings in a data connection file’ in CA. More information, please refer to:
http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010customization.aspx?ID=418b9423-a96c-4e5e-91f9-6a1b010ebb69
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support

Similar Messages

  • How to set a default value for a drop down list box and then apply cascading based on the default value in Infopath 2010.

    Hello Everyone
    I have two drop downs. Both are coming from look up fields from two lists. i want to set a default value(first list item) for the first drop down list box and then apply cascading based on the default value for the next drop down list box. I found one article(http://www.bizsupportonline.net/infopath2010/display-first-item-drop-down-list-box-infopath-2010.htm)
    where in i can set a default value but i can't apply cascading based on that default value. Any suggestions would be highly appreciated.
    Thanks
    Ramanjulu Naidu N

    Hey Ramanjulu,
    Take a look at the below article which I believe will answer your question.
    http://basquang.wordpress.com/2010/03/29/cascading-drop-down-list-in-sharepoint-2010-using-infopath-2010/
    Daniel Christian (MCTS)

  • Multiple default values for Selection type variable

    Hi all,
    I am using Bex 3.5. I have a fundamental doubt while creating a User Entry, Selection Option, Optional type variable.  I am trying to include multiple single variables in the default section, but it accepts only one. Is it possible to add multiple default values to the variable so that they show up in the selection screen when we run the report via Bex Analyzer ?
    Thanks for the inputs !
    Regards
    Snehith.

    Hi,
    In one of my bi7 reports, i remember i have given multiple default values in a single variable. For example i wanted to have multiple material types in my selection screen.
    But i have to check out the type of that user entry variable.
    Hope the above reply was helpful.
    Kind regards,
    Ashutosh singh

  • Multiple Default Values in a Multi-Select LOV Parameter?

    Hi,
    I have a report in BI Publisher standalone version 10.1.3.4. The report has a list of values called org_lov. This lov is attached to a multi-selection p_org_code parameter from which it is desirable to also have multiple default values.
    For example, if org_lov has the following values:
    100
    101
    102
    103
    104
    105
    106
    I would like to have 3 default values and have 100, 101,105 as the defaults if the user doesn't specifically select anything from the LOV. So far my testing has only allowed a single default value.
    Here are my settings:
    Data type = string
    Multiple Selection = checked
    Can select All = checked (all values passed)
    On the Default Value field, I have tried the following:
    1. 100, 101,105
    2. [100, 101,105]
    3. '100', '101','105'
    4. (100, 101,105)
    5. ['100', '101','105']
    6. ('100', '101','105')
    I don't need these default values highlighted in the LOV, I just need it passed correctly to the query (a data template).
    Thank you in advance for any input.

    Hi,
    Sorry for the delayed reply. I tried what you suggested but the problem is that by having the "Multiple Selection" property of the parameter unchecked, the result is that it allows the user to only have a single value passed. The user wants the option to select multiple values AND also have the multiple default values.
    Thanks anyway.

  • Setting the Default Value for a dynamic select menu

    Hi I have a php page with 2 forms on it, one feeds the other to achieve a drill down (manufacturer > model). In the second select menu I have a default static value "Select Aircraft Model", I want to set a value for the first dynamic select menu to read "Select Aircraft Manufacturer". When I add a static value to my list it tells me I alreay have a dynamic behavior on this menu and to choose a different one. I have included the code for both menus. Thank you in advance, I know this must be a stupid question, but it's got me stumped.
    Tom
    //This is the menu I want to add the default static value to//
    <td width="667"><select name="airMake" style="width: 200px;"onchange="this.form.submit();" id="airMake">
            <?php
    do {
    ?>
            <option value="<?php echo $row_rsAirManufacturer['aircraft_manufacturer']?>"<?php if (!(strcmp($row_rsAirManufacturer['aircraft_manufacturer'], ((isset($_POST["airMake"]))?$_POST["airMake"]:"")))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsAirManufacturer['aircraft_manufacturer']?></option>
            <?php
    } while ($row_rsAirManufacturer = mysql_fetch_assoc($rsAirManufacturer));
      $rows = mysql_num_rows($rsAirManufacturer);
      if($rows > 0) {
          mysql_data_seek($rsAirManufacturer, 0);
          $row_rsAirManufacturer = mysql_fetch_assoc($rsAirManufacturer);
    ?>
          </select>
          </td>
      </tr>
    </table></form>
        <form action="quoteResult.php" method="post" name="quoteForm">
          <table width="100%" border="0" cellpadding="5px">
            <tr>
              <td width="260"style="color: #000; text-align: right;">Aircraft Model:</td>
              <td colspan="2"><span id="spryselect2">
    //This is the menu that works correctly//
                <select name="airModel" style="width: 200px;" id="airModel">
                  <option value="" <?php if (!(strcmp("", ((isset($_POST["airMakeField"]))?$_POST["airMakeField"]:"")))) {echo "selected=\"selected\"";} ?>></option>
                  <?php
    do { 
    ?>
                  <option value="<?php echo $row_rsAirModel['aircraft_model']?>"<?php if (!(strcmp($row_rsAirModel['aircraft_model'], ((isset($_POST["airMakeField"]))?$_POST["airMakeField"]:"")))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsAirModel['aircraft_model']?>Select Aircraft Model</option>
                  <?php
    } while ($row_rsAirModel = mysql_fetch_assoc($rsAirModel));
      $rows = mysql_num_rows($rsAirModel);
      if($rows > 0) {
          mysql_data_seek($rsAirModel, 0);
          $row_rsAirModel = mysql_fetch_assoc($rsAirModel);
    ?>
                  </select>

    Change this -
    <select name="airMake" style="width: 200px;"onchange="this.form.submit();" id="airMake">
    to this -
    <select name="airMake" style="width: 200px;"onchange="this.form.submit();" id="airMake">
    <option value="-1">Select Aircraft Manufacturer</option>
    Then if the value of 'airMake' is -1 you know that no choice was made.

  • Set Default Value for People Picker in List Template current user

    Hi,
    I have field definition in my custom list
      <Field ID="{26763808-64BB-4A3C-93A0-ED45AF783D45}"  Type="User" Name="RequestedBy" DisplayName="Requested By" Required="FALSE" ></Field>
    I need to set default current user in this.
    I found few options with javascript.
    Thanks in Advance.
    Where I can find on set of default commands like Today
    Hari

    Hi,
    Default current user can’t be got in calculated column like Today. I suggest that use SPD Workflow described above or JavaScript. Open NewForm page of the list, then add “pageview=shared&toolpaneview=2”
    to the page URL, click Enter to go to edit mode. Then add a Content Editor Web Part to the bottom of NewForm page, copy the code bellow into Source Editor of CEWP.   
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript" src="http://come:100/sites/collection1/Shared Documents/jquery.SPServices-0.7.0.js"></script>
    <script type="text/javascript">    
    $(document).ready(function(){
    var CurrUser=$().SPServices.SPGetCurrentUser({
    fieldName: "Name", debug: false});
    $('#ctl00_m_g_dab5800a_09ac_4f35_97f6_9b5496127f68_ctl00_ctl04_ctl02_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_upLevelDiv').html(CurrUser);
    </script>
    Note:
    download jquery.SPServices-0.7.0.js here and upload it to your own site:
    http://spservices.codeplex.com/SourceControl/list/changesets, and then replace the route of jquery.SPServices-0.7.0.js above with the route in your site. ctl00_m_g_dab5800a_09ac_4f35_97f6_9b5496127f68_ctl00_ctl04_ctl02_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_upLevelDiv
    is the id of the people-picker, please find it in your own NewForm page.
    Another method, you can use Event Handler. Here is the example code.
    public
    override void ItemAdded(SPItemEventProperties properties)
    if (properties.ListTitle == "listname")//replace listname with your list.
    SPWebcurrentWeb = properties.OpenWeb();
    SPUseruser = currentWeb.SiteUsers.GetByID(properties.CurrentUserId);
    SPListItemliitem = properties.ListItem;
    SPFieldUserValuefieldUser =
    newSPFieldUserValue(currentWeb, user.ID, user.LoginName);
          liitem["currentuser"] = fieldUser;//replace currentuser with your field name.    
          liitem.Update();
    //base.ItemAdded(properties);
    If anything unclear, please feel free to ask.
    Thanks.
    Emir Liu
    TechNet Community Support

  • Select options default value

    Hi,
    Kindly assist me on how to set a default value for dynamically created Select options.
    I am coding the below code snippet for default value and it's working but when I remove the default value for the select option on portal screen ...I encounter a dump stating line type does not match with internal table.
    wd_this->m_wd_select_options = wd_this->wd_cpifc_wdr_select_options_e( ).
    init the select screen
      wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).
        lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'STRING' ).
        assign lt_range_table->* to <range_table>.
        insert initial line into table <range_table> assigning <range_table_line>.
        assign component 'SIGN'   of structure <range_table_line> to <sign>.
       assign component 'OPTION' of structure <range_table_line> to <option>.
        assign component 'LOW'    of structure <range_table_line> to <low>.
        assign component 'HIGH'   of structure <range_table_line> to <high>.
        <sign>   = 'I'.
        <option> = 'EQ'.
        <low>    = 'ZA'.
        clear <high>.
        wd_this->m_handler->set_range_table_of_sel_field(
          i_id          = 'DY_PARVW'
         it_range_table     = lt_range_table ).
    Points will be rewarded!!!!

    Hi.
    I use the following code (snippet) to add default values:
    lt_range = lr_selop->create_range_table(
                                        i_typename = 'VKORG' ).
      lr_selop->add_selection_field(
                         i_id = 'VKORG'
                         i_within_block = lv_id_gdata
                         i_no_intervals = abap_true
                         i_no_extension = abap_true
                         i_obligatory = abap_true
                         i_read_only = abap_true
                         it_result = lt_range
                         i_value_help_type = if_wd_value_help_handler=>co_prefix_none ).
    DATA:
            lr_user        TYPE REF TO zcl_user,
            lr_param       TYPE REF TO data,
            lr_headerline  TYPE REF TO data.
      DATA:
            ls_tmprange    TYPE rsparams.
      FIELD-SYMBOLS:
                     <fs_param>      TYPE ANY,
                     <fs_range>      TYPE ANY,
                     <fs_rangetable> TYPE table.
      lr_user = zcl_user=>get_instance( ).
      lr_param  = lr_user->get_usermaster_param(
         param_name = param_name
      ASSIGN lr_param->* TO <fs_param>.
      MOVE <fs_param> TO ls_tmprange-low.
      IF ls_tmprange-low IS NOT INITIAL.
        ls_tmprange-sign = zcl_salsa_assistance=>userparam_sign_default.
        ls_tmprange-option = zcl_salsa_assistance=>userparam_option_default.
        ASSIGN lr_range->* TO <fs_rangetable>.
        CREATE DATA lr_headerline LIKE LINE OF  <fs_rangetable>.
        ASSIGN lr_headerline->* TO <fs_range>.
        MOVE-CORRESPONDING  ls_tmprange TO <fs_range>.
        APPEND <fs_range> TO <fs_rangetable>.
      ENDIF.
    lr_user->get_usermaster_param( param_name = param_name ) just returns a data reference to a parameter value.
    After assigning this value to the range table i do not have to call set_range_table_of_sel_field cause lr_range is already a reference to the range table.
    This works well and I can remove the default value without getting dumps.
    Cheers,
    Sascha

  • Set default value for people picker only when user checks a checkbox (Sharepoint 2010)

    The javescript in below link works for me.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/2b130f64-3db2-484a-9a53-ccbe18d2c5de/set-default-value-for-people-picker-in-list-template-current-user?forum=sharepointgenerallegacy
    However, I'd like to set default user for people picker only when user checks a checkbox. 
    I am new to  development. Could you please help me on this requirement ?
    Thank you very much. 

    Hello,
    Use this link to to validate checkbox value, if true then set the person or group value (i.e. as posted in your link).
    http://geekswithblogs.net/haniamr/archive/2011/03/10/validate-that-a-checkbox-is-checked-using-javascript.aspx
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • 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

  • Default Values for Select-options In Webdynpro-ABAP

    Hi Freinds,
    Kindly,Help me in setting the Default values for the Select-options in Webdynpro ABAP.
    Here the Node and the Attributes are Created Dynamically, and then Displayed Select-options Component View.
    Regards,
    Xavier.P

    Xavier Reddy Penta sent me this question via email and I answered it directly yesterday. Here is the solution that I provided to him, so that it is stored with the original question:
    I believe your problem is that you are not setting the value into the range correctly.  You are setting it directly into the field symbol of the range like such:
    <FS> = L_STRING2.
    But ranges are deep objects. They have four fields: Sign, Option, High, and Low. This is from the online help:
    1.     sign of type c and length 1. The content of sign determines for every row whether the result of the condition formulated in the column is included or excluded in the entire resulting set for all rows. Evaluable values are "I" for include and "E" for exclude.
    2.     option of type c and length 2. option contains the selection option for the condition of the row in form of logical operators. Analyzable operators are "EQ", "NE", "GE", "GT", "LE", "LT", "CP" and "NP" if column high is initial, and "BT", "NB" if column high is not initial. With the options "CP" and "NP", the data type of the columns low and high must be of the data type c, and special rules apply for entries on the selection screen.
    3.     low of the data type defined after FOR. This column is designated for the comparison value or the lower interval limitation.
    4.     high of the data type defined after FOR. This column is designated for the upper interval limitation.
    So when you are moving the value into the field symbol you are setting it into the sign column.
    Here is an example of how you can access the components of the range:
    * create a range table that consists of this new data element
        lt_range_table =
          wd_this->lv_sel_handler->create_range_table(
               i_typename = l_typename ).
        IF l_fieldname = 'CARRID'.
          FIELD-SYMBOLS: <tab>         TYPE INDEX TABLE,
                             <struct>      TYPE ANY,
                             <wa>          TYPE ANY,
                             <option>      TYPE char2,
                             <sign>        TYPE char1,
                             <high>        TYPE ANY,
                             <low>         TYPE ANY,
                             <wa_values>   TYPE ANY.
          ASSIGN lt_range_table->* TO <tab>.
          APPEND INITIAL LINE TO <tab> ASSIGNING <wa>.
          ASSIGN COMPONENT 'OPTION' OF STRUCTURE <wa> TO <option>.
          ASSIGN COMPONENT 'HIGH' OF STRUCTURE <wa> TO <high>.
          ASSIGN COMPONENT 'LOW' OF STRUCTURE <wa> TO <low>.
          ASSIGN COMPONENT 'SIGN' OF STRUCTURE <wa> TO <sign>.
          <sign> = 'I'.
          <option> =  'EQ'.
          <low> = 'AA'.
        ENDIF.

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
    Rgds,
    CV

    Hi,
    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
    haritha

  • Maintaing a default value for a particular field in the selection screen

    Hi all,
    How to maintain a default value for a particular field in the Selection Screen of a Standard report
    Regards
    Ajay

    >
    ajay babu wrote:
    > Hi all,
    >
    > How to maintain a default value for a particular field in the Selection Screen of a Standard report
    >
    > Regards
    > Ajay
    Create a variant for your standard program and assign this variant to the field 'Start with variant' while creating transaction code for the standard program in the transaction 'SE93'.
    Regards
    Rajesh.

  • Set of default values for Select-Options

    Hi Gurus,
    I have a requirement where I need to set default values for select options
    ex: SELECT-OPTIONS: S_MTART FOR MARA-MTART
    default values must be ERSA - HIBE- FHMI - DIEN - GEST
    Please tell me how to do it.
    Effective replies will be rewarded with full points
    Karthik

    Hi,
    For each SELECT-OPTION, you can only specify one DEFAULT.
    You must specify the default value g in its internal format, e.g. "SELECT-OPTIONS DATE FOR SY-DATUM DEFAULT '19931224'", not "... DEFAULT '24.12.1993'".
    The default value g should normally be a literal because, at runtime when you use SUBMIT, it is transferred to the selection options table sel so early that no value can be assigned to the field g. System fields like SY-DATUM are an exception here because the system usually assigns values to them as soon as the report processing starts.
    When you use user-defined selection screens in your programs that you do not call using SUBMIT, the DEFAULT value is transfered when the selection screen is first called. In this case, therefore, you can use other fields g.
    regards,
    sowjanya
    Message was edited by: sowjanya suggula

  • Default value for selection screen field

    Hi all,
      I am using LDB PNPCE. I want to give default value for field Personnel area on selection screen.
    How can I do it?
    Thanks
    Rahul

    Hi Rahul,
    In the INITIALIZATION event we can set the default values for selection screen fields.
    INITIALIZATION.
    loop at screen.
    if screen-name = 'S_MATNR-LOW'.
    CLEAR S_MATNR.
    s_matnr-low = '1234'.
    s_matnr-option = 'EQ'.
    s_matnr-sign = 'I'.
    append s_matnr.
    CLEAR S_MATNR.
    s_matnr-high = '5678'.
    s_matnr-option = 'EQ'.
    s_matnr-sign = 'I'.
    append s_matnr
    clear s_matnr.
    endif.
    endloop.
    Hope it helps.
    Mark if useful
    Regards,
    Saumya

  • Multiple single value for default value?!?

    Hi guys,
    by making a characteristic value variable how can I add more than one value (not interval) for default value? I cannot even add more value if the char. variable represents multiple single values...
    Thx.

    Hi,
    For that you can make use of customer exit variable.
    else refer this link:[Variable with Multiple Default Values;
    Regards,
    Rajkandula

Maybe you are looking for

  • Switch statement with enumerated types

    Hello, I'm currently having problems (error in eclipse) using enums in a switch block. Eclipse says: "The enum constant Constants.AnalysisType.<each case> reference cannot be qualified in a case label. for each of the cases that I try to use the enum

  • ABAP Proxy without SOAP adapter in PI7.3

    Hi All, We have dual stack implementation of PI7.3 but we do not wish to use the SOAP adapter for configuring an ABAP proxy scenario. Is this possible? Is the Javastack only configuration in NW Admin available for use in dual stack implementation als

  • Vendor Consignment Settlement - Invoice verification - MRKO

    Hello All, Can someone please let me know what I am missing in configuration, because when I try to settle via MRKO transaction get the message below. I have gone through configuration trying to figure out what I have missed. Since I don't see "settl

  • CSV file template for Uploading PO confirmaiton

    Dear all, We have activated Badi for Upload PO confirmations for a supplier in SNC 7.0. Request if any of you can please let me know where can I find the CSV upload file template. Thanks, mahesh.

  • Editable element in a PDF?

    Sorry for the newbie question but I would like to know how I can make a form element in a PDF be editable. I have made the form and the element can be changed, but not saved for some reason. When I open the PDF in Reader and edit the form element, th