Thursday, October 29, 2015

Set PartyList using JavaScript in MSCRM

Here is the code to set the party list values using java script. 


Party List is a data type in CRM, using which you can set more than one records of 
an entity for a single field.
Part List type field, renders as Lookup on the form, but it works as multi select lookup

   var partyRequired = Xrm.Page.getAttribute("to");
    // Create new array
    var partlist = new Array();
    partlist[0] = new Object();
    partlist[0].id = Id; //Guid (i.e., Guid of User or Contact etc)
    partlist[0].name = "Name"//Name (i.e., Name of User or Contact etc)
    partlist[0].entityType = "systemuser"//entity schema name of account or contact
    // Set array value    partyRequired.setValue(partlist);

Thank you...

No comments:

Post a Comment