Let make it a smallest blog possible.

below code i have been using without any issue when it comes to setting a partylist or multi lookup in CRM. In the below code i am retrieving the contact id or the id of entity which is there in the regarding field & setting it on the “From” field.

function setCallFrom() {

var lookup = new Array(); //create a new array
lookup = Xrm.Page.getAttribute(“regardingobjectid”).getValue(); //get the value from lookup
if (lookup != null) {
var name = lookup[0].name; // get the name from first array
var id = lookup[0].id; //get id from the first array
var entityType = lookup[0].entityType; // get the entity name from the retrieved id
if (entityType == “contact”) {  //check to see if this is contact , then proceed

var value = new Array(); //create a new array for target
value[0] = new Object(); //store the value in an object
value[0].id = id; // get id from the object
value[0].name = name; // get name from the object
value[0].entityType = “contact”; //give the entity name

Xrm.Page.getAttribute(“from”).setValue(value); //finally set the value on from field.



With slight modifications you can use the code on any other activity if you need to set partylist.

Call this function on Onload of the record or on onchange of the regarding field.

hope this helps!