Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Javascript to get the lookup id?

$
0
0

Hi All,

          I have one dropdown with multiple items. I want to take the guid of the selected item in lookup on its chnged event. 

My code is like below, but Xrm.Page.data.entity.attributes.get('new_item'); this gives null . Anyone can figure it out?

var lookupItem = new Array();
lookupItem =Xrm.Page.data.entity.attributes.get('new_item');// Xrm.Page.getAttribute("new_item").getValue

if(lookupItem[0] != null)
{
var name = lookupItem[0].name;
var guid = lookupItem[0].id;
var entType = lookupItem[0].entityType;
}


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>