"тнιѕ вℓσg ¢συℓ∂ ѕανє уσυя мσηєу ιƒ тιмє = мσηєу" - ∂.мαηנαℓу
Showing posts with label How to retrieve lookup text value / id using Javascript in CRM 2011 OR How to get lookup text value / Id in CRM 2011. Show all posts
Showing posts with label How to retrieve lookup text value / id using Javascript in CRM 2011 OR How to get lookup text value / Id in CRM 2011. Show all posts

Thursday, 31 March 2011

How to retrieve lookup text value / id using Javascript in CRM 2011 OR How to get lookup text value / Id in CRM 2011

Related Post: How to retrieve lookup attribute from Plugin in CRM 2011 

 http://crmdm.blogspot.com/2011/06/how-to-retrieve-lookup-attribute-from.html  


Code Snippet:

var lookupObject = Xrm.Page.getAttribute("yourlookupattributename");

    if (lookupObject != null)
  {

        var lookUpObjectValue = lookupObject.getValue();

        if ((lookUpObjectValue != null))
        {

         var lookuptextvalue = lookUpObjectValue[0].name;

         var lookupid = lookUpObjectValue[0].id;

        }

  }