Assign record to a user/team programmatically

//Calling the function Example

AssignRecord(SystemUser.EntityLogicalName, SystemUser.Id,
Account.EntityLogicalName, Account.Id);

/// <param name=”AssigneeName”>Name of the user/team which the record is assigned to</param>
/// <param name=”AssigneeId”>ID of the user/team which the record is assigned to</param>
/// <param name=”TargetName”>Name of entity which is being Assigned</param>
/// <param name=”TargetId”>Guid of entity which is being Assigned</param>
private void AssignRecord(string AssigneeName, Guid AssigneeId, string TargetName, Guid TargetId)
{
AssignRequest assignClient = new AssignRequest
{
Assignee = new EntityReference(AssigneeName, AssigneeId),
Target = new EntityReference(TargetName, TargetId)
};

_service.Execute(assignClient);
}

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

Workflow Elements by Aiden Kaskela

Business Solutions (CRM) MVP, Contractor, Evangelist

MSDYNAMICSBLOG BY DEEPESH

Real Experiences from Analyzing, Architecting, developing and working with Dynamics CRM, Dynamics 365 and sometimes .net

Mark Margolis's Blog

It's about Software, CRM, Product Development and sometimes Food.

GT // CRM

Gareth Tucker on Microsoft Dynamics CRM

Donna Edwards

Sharing my Journey with Dynamics 365

The WordPress.com Blog

The latest news on WordPress.com and the WordPress community.

%d bloggers like this: