1
약속의 RequiredAttendees 특성에 계정을 추가하려고합니다. 내 코드는 이메일, 팩스, 편지에서 완벽하게 작동합니다. 그러나 언제 약속이 만들어지면 속성을 추가하지 않습니다.crm 2011의 약속에 RequiredAttendees를 추가하는 방법
string[] ToArr = new string[1];
Guid To = Guid.Empty;
try
{
if (Utility.To.Contains(";"))
{
ToArr = Utility.To.Split(';');
}
else
{
ToArr[0] = Utility.To;
}
EntityCollection collToParty = new EntityCollection();
for (int i = 0; i < ToArr.Length; i++)
{
if (Guid.TryParse(ToArr[i].ToString(), out To))
{
EntityReference to = new EntityReference(Utility.Toguidentityname, To);
Entity toParty = new Entity("activityparty");
toParty.Attributes.Add("partyid", to);
collToParty.EntityName = Utility.Toguidentityname;
collToParty.Entities.Add(toParty);
}
else
{
throw new Exception("Il valore del campo della stringa " + To + " toGuid non è un GUID:" + ToArr[i].ToString());
}
}
if (entity.LogicalName.Equals("appointment"))
entity.Attributes.Add("RequiredAttendees", collToParty);
else
entity.Attributes.Add("to", collToParty);
}
catch (Exception ex)
{
LoggerObj.writeLog("Errore:" + ex.Message);
throw;
}