Get LookUp Text into Text Field :
function GetLookupDetails()
{
var lookupItem = new Array();
//This is Field Name and should be in Small
letters
if(lookupItem != null)
{
var name =
lookupItem[0].name;
//This is
to Get GUID which is ContactId in SQL Table, Use this to Query remaining
details.
var guid =
lookupItem[0].id;
var
entType = lookupItem[0].entityType;
alert(name);
alert(guid);
alert(entType);
//This is to Set Values to Textbox, Remember not for Lookup
fields.
Xrm.Page.getAttribute("new_mainphone").setValue(guid);
Xrm.Page.getAttribute("new_homephone").setValue(guid);
}
}
No comments:
Post a Comment