Hi,
How to enable multi select option on lookup dialog and then add to grid when add button in clicked using JavaScript.
I wrote code for this but its not working. It is showing single record lookup window and how to add that selected record to grid.
function showLookupDialog(SelectedEntityTypeCode,SelectedControl) {
try {
debugger;
var serverurl = Xrm.Page.context.getClientUrl();
var DialogOptions = new Xrm.DialogOptions();
DialogOptions.width = 600;
DialogOptions.height = 600;
//Change
var objecttypecode = "";
if (parent.Mscrm.XrmInternal.getEntityCode != null && parent.Mscrm.XrmInternal.getEntityCode != undefined)
objecttypecode = parent.Mscrm.XrmInternal.getEntityCode("contact");
else
objecttypecode = parent.Mscrm.XrmInternal.prototype.getEntityCode("contact");
var url = serverurl + "/_controls/lookup/lookupsingle.aspx?LookupStyle=multi&class=null&objecttypes=" + objecttypecode + "&browse=0&ShowNewButton=1&IsInlineMultiLookup=0&ShowPropButton=1&DefaultType=10015";
Xrm.Internal.openDialog(url, DialogOptions, null, null, CallbackFunction);
} catch (e) {
alert(e.message);
}
function CallbackFunction(result){
for (var i = 0; i < result.items.length; i++) {
var id = result[i].id;
}
alert(result);
}
}
*This post is locked for comments
I have the same question (0)