Assign a record to user in CRM 2011, 2013 and 2015

Here is the code for assigning a record to other user.

AssignRequest assign = new AssignRequest

{
     //systemuser; i.e., User to whome you are assigning the entity to
     Assignee = new EntityReference(“systemuser”, guidUserId),
     //Current record which you are assigning to the user
     Target = new EntityReference(“account”, guidAccount)
};
// Execute the Request
service.Execute(assign);



Happy CRM’ing
Gopinath.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s