Lookup for more than one entity RRS feed

  • Question

  • Hi all,

    I am having a lookup field which is able to select an account, I would like to use the same lookup for selecting contact also. How can i do it? (I want the functionality which is used for 'Regarding' field in Tasks)

    Friday, March 20, 2009 6:24 AM


  • Having a field that maps to a customer in a custom entity is not supported.  You have a couple options to get around it.  Some are more desirable than others.

    • Create two fields on your custom entity, one for contact and one for account.  In Javascript you can handle logic to ensure that only one is specified. 
    • Option 2:  To map the field to another entity you would have to create a varchar field on the other entity and set the field in javascript or in plugin.  It won't be of a lot of use to you unless you want it there simply for data purposes.  You couldn't display it on the form since it is just a GUID in string.
    •  Another options, unsupported of course, is to follow this post and create a field that mimicks the customer lookup.  http://billoncrmtech.blogspot.com/2009/02/client-side-scripting-customer-fields.html.  I haven't implemented it but it looks to make for the best user experience.


    Friday, March 20, 2009 6:40 AM