Search code examples
dynamics-crm-4

Error in updating appointment


I am trying to add more required attendees. But i am running up with errors and the code is -2146233087.

activityparty activityParty = new activityparty();         
activityParty.partyid = new Lookup();            
activityParty.partyid.Value = contact.contactid.Value;     
appointment.requiredattendees = new activityparty[] { activityParty };   
service.Update(appointment);

Solution

  • Hi atlast i found the issue, i missed the type of entity and tats the problem. But it is simply throwing error as exception without telling that and after adding type it is fixed.

    activityparty activityParty = new activityparty();         
    activityParty.partyid = new Lookup();            
    activityParty.partyid.Value = contact.contactid.Value;     
    **activityParty.partyid.type = "contact";**
    appointment.requiredattendees = new activityparty[] { activityParty };   
    service.Update(appointment);