Search code examples
dynamics-crm-2011dynamics-crmdynamics-crm-4microsoft-dynamicsdynamics-crm-2013

Assign a Record to a team in dynamics crm 2013


Assign a record to user is fine but how to assign a record to team i'm unable to find the teamownershipid could you have any ideas.


Solution

  • You still need to use the AssignRequest, the only change is the LogicalName inside the EntityReference for the Assignee, instead of systemuser you need to put team.

    An example:

    Guid accountId = new Guid("90F8889F-EB95-E781-8417-000C44420CBC");
    Guid teamId = new Guid("A8AA28B4-9015-DF11-8062-000E0CA08051");
    
    AssignRequest assignRequest = new AssignRequest
            {
                Assignee = new EntityReference("team", teamId),
                Target = new EntityReference("account", accountId)
            };
    service.Execute(assignRequest);