Home > CRM 2011, Plug-Ins > CRM 2011 – Team sharing in Plug in
  1. March 18, 2012 at 5:29 AM

    I am writing the below code to assign a account record to a team . I am getting an error on the last line “The given key was not present in the dictionary.” .

    Could you please tell me where is the problem ?

    Guid TeamID = new Guid(“9e4c4497-2811-e111-bcdf-00155d017a04”);
    Guid accountID = new Guid(“50345443-8a70-e111-a46f-00155d017a04”);

    AssignRequest assignRequest = new AssignRequest()
    {
    Assignee = new EntityReference
    {
    LogicalName = “team”,
    Id = TeamID
    },

    Target = new EntityReference(“account”, accountID)
    };

    service.Execute(assignRequest);

  1. No trackbacks yet.

Leave a comment