Monday, February 6, 2012

MS CRM 2011: How to read the value from Lookup?

Many times we required to read lookup value and Guid of Lookup for this use the following line of code:

function movecase() {

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

if (lookupObject != null)
{

var lookUpObjectValue = lookupObject.getValue();

if ((lookUpObjectValue != null))
{

var lookuptextvalue = lookUpObjectValue[0].name;
alert(lookuptextvalue);
var lookupid = lookUpObjectValue[0].id;
alert(lookupid);
}

}

No comments:

Split the String values with a special character in MS Flow to convert this into Array

 Many times we have a requirement to prepare the Mailing address for some of the documents, suppose there are Address Line1, Address Line2, ...