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

Enable multiple select option in lookup dialog window and add to grid in CRM

$
0
0

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(urlDialogOptionsnullnullCallbackFunction);
        } catch (e) {
            alert(e.message);
    
        }
        function CallbackFunction(result){
            for (var i = 0i < result.items.lengthi++) {
                var id = result[i].id;
                
                
                


            }
            alert(result);
        }
}

Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images