Tuesday, May 1, 2012

Setting Values for Lookup fields in MS CRM 2011

The following table describes five types of lookup fields.

Lookup Type Description
simple lookup
: Allows for a single reference to one type of entity.
customer lookup
: Allows for a single reference to either an account or contact record.
owner lookup
: Allows for a single reference to either a team or system user record.
partylist lookup
: Allows for multiple references to multiple entities.
regarding lookup
: Allows for a single reference to multiple entities.

The following apply when setting the value of a lookup using a query string arguments to a form:

  • For simple lookups you must set the value and the text to display in the lookup. Use the suffix “name” with the name of the attribute to set the value for the text.

    Do not use any other arguments.

  • For customer and owner lookups you must set the value and the name in the same way you set them for simple lookups. In addition you must use the suffix “type” to specify the type of entity. Allowable values are account, contact, systemuser, and team.

  • You cannot set the values for partylist or regarding lookups.
Sample
To set values for lookup fields, use the data value, the name value, and for customer or owner lookups only, specify the type value for the respective field. The following sample sets the owner field to a user named “Mark Folkerts”.
The unencoded value for the extraqs parameter is “ownerid={B8C6E040-656E-DF11-B414-00155DB1891A}&owneridname=Mark Folkerts&owneridtype=systemuser”.

thanks,
yes.sudhanshu

1 comment:

  1. Good one !! helpful for custom lookup which I was struggling a while back.

    ReplyDelete