user3631102
user3631102

Reputation: 69

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.

Upvotes: 0

Views: 1486

Answers (1)

Guido Preite
Guido Preite

Reputation: 15128

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);

Upvotes: 2

Related Questions