Dear all ;
i am trying to create party list in the requiredattendees field of appointment through java script it is creating the party list but the last value of the partylist here is my code
if(Xrm.Page.getAttribute("requiredattendees").getValue()!=null)
{
var party = Xrm.Page.getAttribute("requiredattendees");
var partyList = party.getValue();
for (var idx = 0; idx < partyList.length; ++idx)
{
var activityParty = new Object();
activityParty.PartyId = { Id: partyList[idx].id, LogicalName:partyList[idx].entityType };
activityParty.ActivityId = { Id: chk.ActivityId, LogicalName: "appointment" };
activityParty.ParticipationTypeMask = { Value: 5 };
createEntity(activityParty, "ActivityParty", "");
}
}
var jsonEntity = JSON.stringify(ent);
var createEntityReq = new XMLHttpRequest();
var ODataPath = Xrm.Page.context.getServerUrl() + "/XRMServices/2011/OrganizationData.svc";
createEntityReq.open("POST", ODataPath + "/" + entName + "Set" + upd, false);
createEntityReq.setRequestHeader("Accept", "application/json");
createEntityReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
createEntityReq.send(jsonEntity);
var newEntity = JSON.parse(createEntityReq.responseText).d;
return newEntity;
}