How to set value for a picklist in CRM 2011 ? RRS feed

  • Question

  • hello all, 

           How can i set value to the picklist. am trying to map  two picklist in crm 2011. like.. based on selecting country appropriate state should appear in the state picklist. how can i do this ? found some links but they are not working for me !!

    is there anything wrong with the information given it the following link ?


    • Edited by Pradeep47 Thursday, March 8, 2012 11:44 AM
    Thursday, March 8, 2012 10:54 AM

All replies

  • Hi

    please can you explain exactly what you want to achieve and when you want to set picklist values? or do you want to set a value of a picklist when the value of another picklist has been set by the user?

    in that cas you just have to use javascript in you webform on the onChange event of the Picklist hat the value has been set. To populate the value to natoher picklist you can use a sitch case that will check which value has been selected und based on this you can then via the same javascript code set the value of the picklist according to your goal.

    Below is also a link where you will find a tutorials for cascading picklist


    Please make sure you Vote or marked as answer if this Post helped you or answer your question

    If this post answers your question or was helpful, please click "Mark As Answer" on the post and "Mark as Helpful" Be wise

    Thursday, March 8, 2012 12:02 PM
  • Thanks ,  I want to set the  value of a picklist when the value of another picklist changes !! THanks for the links , but on my child pick list i have around 80 states name, base on the country i have to filter it !! this code works by removing the all the items from the list to get one value. that means to get one state name . i have to remove 79 states !!!!! just wondering, can i use something like  "Add" function instead of "Remove" 

    this code is from the provided link: 

    //BEGIN: If the picklist is set to HMO
               if(picklistOneSelectedText == "HMO")
        //Remove these values
       if (optionText == "PPO 500" || optionText == "PPO 750" || optionText == "POS Silver" || optionText == "POS Gold")


    • Edited by Pradeep47 Thursday, March 8, 2012 12:37 PM
    Thursday, March 8, 2012 12:13 PM
  • It looks pretty solid and on par with what I would expect.  I don't see any methodology issues and it looks supported.

    Jamie Miley
    Check out my about.me profile!
    Linked-In Profile
    Follow Me on Twitter!

    Thursday, March 8, 2012 12:28 PM
  • Hello Pradeep,

    You are seeing right solution in http://www.madronasg.com/blog/dependent-option-sets-crm-2011

    I have implemented Dependent picklist successfully using above link.

    Can you tell me please where are you getting problem in that ?

    • Proposed as answer by DynamicsCRM31 Tuesday, September 11, 2012 5:41 AM
    Tuesday, September 11, 2012 5:14 AM
  • Pradeep,

    I would use filtered lookups.  I wrote a blog on it, so for more details see here


    but baslcally, what I would do is:

    1) Create a new custom entity called "Country".  Enter in all the new values for Country into this table.

    2) Create a new custom entity called "State". 

    3) Create a lookup from Country to State.  (One Country can have many States). Put the Country field on the State form.

    4) Populate the State entity (import a spreadsheet) with the states and countries lined up.  Only Countries in your Country table will import, if you are mapping correctly.

    5) I'm sure you have something like Accounts or Contacts you want this Country/State stuff to work on, so assuming Accounts, create a relationship between Country and Account, creating the Country lookup on the Account.

    6) Create a relationship between State and Account, so State is a lookup on Account.

    7) Place the new Country and State fields on the Account form.  (Country above State, so they user fills out Country first.)

    8) ** The filtered lookup key **...  On the State field, create a filtered lookup so that it only displays States linked to the Country that has been selected.



    Thursday, September 13, 2012 6:35 AM