Home

Showing posts with label Set lookup value in ms crm scrips. Show all posts
Showing posts with label Set lookup value in ms crm scrips. Show all posts

Tuesday, December 8, 2015

Set Lookup Value using Javascripts in CRM

function set_LookupValue(fieldName, id, name, entityType) {

        if (fieldName != null && id != null) {
            var lookupValue = new Array();
            lookupValue[0] = new Object();
            lookupValue[0].id = id;
            lookupValue[0].name = name;
            lookupValue[0].entityType = entityType;
            Xrm.Page.getAttribute(fieldName).setValue(lookupValue);
        }

    }

Convert subgrid to Comments