How to bind C# array list to CRM 4.0 Picklist RRS feed

  • Question

  • Hello,

      I have custom asp.net application, and my CRM 4.0 has 1-N relation from Contact and custom Entity "Departments"

    In Department i have placed one Picklist. i want to store departments related to particular customer.and different customers may have associated to different departments. 

    How can i store the C# array list to CRM picklist. 

    Please help me out how to implement this from c# code.

    Monday, August 30, 2010 6:22 PM


All replies

  • Are you sure you're not using a Picklist for something which would be better served by a Lookup?  When you say you want "departments related " to another type of record, I assume you mean via the Picklist.  Personally, I would avoid any use of static attributes... such as Picklists... to define dynamic relationships.  That said, you'll need to map your array values to values established for the Picklist.  Is your inquiry about how to set the available options of a Picklist through the Metadata?  Or using established Picklist options and configuring the appropriate value for a record using some information from an array?

    Picklist attributes are fairly simple: they have an integer value, and a string label.  What information does your array have?

    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Monday, August 30, 2010 6:45 PM
  • i want to bind dynamic list of values to crm picklist. and values may vary according to customer or any other attribute.
    Tuesday, August 31, 2010 6:48 PM
  • I recommend you do not use a Picklist.  Picklists are intended to represent a set of static options, and though some control can be made to present those options in a dynamic fashion, it's still intended for the list of options available to ALL records.  Picklist options are defined by the Metadata behind the attribute.  If an option is removed, it is removed from every record which contained that option as its value.  Picklists should have an upper-bound to the number of options they provide, and if the number of options is expected to grow continually, I would seriously look into implementing a Entity/Lookup-based solution to capture the data you need.
    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Tuesday, August 31, 2010 8:17 PM
  • Hi,

    Please this MS Post on depending Picklist:

    Hope this helps.

    Thanks, Ranjitsingh R | http://mscrm-developer.blogspot.com/ | MS CRM Consultant
    Wednesday, September 1, 2010 3:38 AM