With this code, you can set a party list:
function setPartyList() {
var partyRequired = Xrm.Page.getAttribute(“requiredattendees”);
// 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 = entityType; //entity schema name of account or contact
// Set array value
partyRequired.setValue(partlist);
}
Hope this helps!
Karan