locked
Databound Picklist RRS feed

  • Question

  • Hi,

    In CRM 4.0 can we have a possibility of using Databound Picklist?

    As far as I have seen, there is no way to bound Picklist. If there is any js code workaround or unsupported customization to achieve the same?

    Regards,

    Ali


    Paradise lies at the feet of thy mother. - Prophet Mohammed (PBUH)
    Monday, December 20, 2010 6:37 AM

Answers

  • Hi Ali

    You need to get the picklist items using the MetadataService, see example inside the crm sdk about retrieving metadata, some sample code that might help you

    // get the picklist you want by calling the metadataservice
    PicklistAttributeMetadata picklist = ...
    var options = picklist.Options; // this holds the items of the picklist
    // loop through the options variable
    options[i].Label.UserLocLabel.Label // this is the display name
    options[i].Value.Value // this is the integer value


    Kids don't try this at home!
    Monday, December 20, 2010 7:49 AM

All replies

  • Hi Ali,

     

    You can check the post by Jian Wang. Using this post, you can load values from XML file.

    http://jianwang.blogspot.com/2008/01/dynamic-picklist-values-load-from-xml.html


    Jai Ho CRM http://mscrmkb.blogspot.com Skype - amol.gholap

    Mark as answer if a post has answered the question
    Monday, December 20, 2010 6:48 AM
  • Thanks Amol.

    But what about if we want to bind picklist from crm entity for using DataMember and ValueMember type scenario?


    Paradise lies at the feet of thy mother. - Prophet Mohammed (PBUH)
    Monday, December 20, 2010 7:08 AM
  • Hi Ali

    You need to get the picklist items using the MetadataService, see example inside the crm sdk about retrieving metadata, some sample code that might help you

    // get the picklist you want by calling the metadataservice
    PicklistAttributeMetadata picklist = ...
    var options = picklist.Options; // this holds the items of the picklist
    // loop through the options variable
    options[i].Label.UserLocLabel.Label // this is the display name
    options[i].Value.Value // this is the integer value


    Kids don't try this at home!
    Monday, December 20, 2010 7:49 AM
  • Thanks Gayan!

    It seems fit in my scenario.

    At present, my CRM server is on re-installation. I will give it a try and will feedback here later.


    Paradise lies at the feet of thy mother. - Prophet Mohammed (PBUH)
    Monday, December 20, 2010 8:13 AM