locked
Picklist of Contacts RRS feed

  • Question

  • I created a custom entity.  I want to add a picklist which will have the values of all Contacts.  Can this be done with programming?  If so, can someone explain?

    Thanks.

    Friday, October 1, 2010 8:44 PM

Answers

  • You want a Picklist to act as a Lookup for Contact records?  I personally find such an effort highly irrational.  Is there a specific behavior you're trying to accomplish by doing so?  Would it not be simpler to create a new N:1 relationship between your custom entity and the Contact entity and use the corresponding Lookup field for this relationship to capture the connection between the records?
    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Friday, October 1, 2010 8:52 PM
    Moderator
  • You can perform the opposite of your inquiry by making a Lookup field look and act like a Picklist field by using Daniel Cai's example:  http://danielcai.blogspot.com/2009/10/crm-40-convert-lookup-field-to-picklist.html

    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Friday, October 1, 2010 8:55 PM
    Moderator

All replies

  • You want a Picklist to act as a Lookup for Contact records?  I personally find such an effort highly irrational.  Is there a specific behavior you're trying to accomplish by doing so?  Would it not be simpler to create a new N:1 relationship between your custom entity and the Contact entity and use the corresponding Lookup field for this relationship to capture the connection between the records?
    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Friday, October 1, 2010 8:52 PM
    Moderator
  • You can perform the opposite of your inquiry by making a Lookup field look and act like a Picklist field by using Daniel Cai's example:  http://danielcai.blogspot.com/2009/10/crm-40-convert-lookup-field-to-picklist.html

    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Friday, October 1, 2010 8:55 PM
    Moderator
  • Hi,

    I agree with David. You should create N:1 relationship with the contact entity. But if you still want to go with the picklist option then see the below solution:

    MS CRM provides a very good feature of calling MS CRM Web Services using Javascript. On the form load you have to call the Javascript Web Services to Query the desired entity from where you want to fetch the details. It returns the XML with the Entity details. Retrieve the details and pre populate the Order Form attributes with the result.

    So, you have to work with Client Side Web Services - MS CRM

    Please refer below link - how to work with client side web services with MS CRM.
    http://www.stunnware.com/crm2/topic.aspx?id=jswebservice2

    And here is the tool which generates the Javascript Code (very helpful):
    http://www.stunnware.com/crm2/topic.aspx?id=JSWebService

    You have to retrieve all active contacts, loop through the resultset, start adding items to the picklist control.

    Hope this helps.


    Thanks, Ranjitsingh R | http://mscrm-developer.blogspot.com/ | MS CRM Consultant
    • Proposed as answer by Ranjitsingh R Saturday, October 2, 2010 9:59 AM
    Saturday, October 2, 2010 9:59 AM