"тнιѕ вℓσg ¢συℓ∂ ѕανє уσυя мσηєу ιƒ тιмє = мσηєу" - ∂.мαηנαℓу
Showing posts with label How to retrieve a lookup attribute from Plugin in CRM 2011. Show all posts
Showing posts with label How to retrieve a lookup attribute from Plugin in CRM 2011. Show all posts

Saturday, 11 June 2011

How to retrieve a lookup attribute from Plugin in CRM 2011

Related Post : http://crmdm.blogspot.com/2011/03/how-to-retrieve-lookup-text-value-id.html


In CRM 2011 we could use EntityReference to retrieve the lookup attribute from a Plugin.



Consider that we have a Contact lookup named as 'new_contact'. In the plugin we could use the following code to retrieve the lookup.

Code snippets:

CRM 2011:
EntityReference
contactlookup = (EntityReference)targetEntity.Attributes["new_contact"];



CRM 4:

Lookup contactlookup = (Lookup)targetEntity["new_contact"];