AssignRequest Class

Applies To: Microsoft Dynamics CRM 2013, Microsoft Dynamics CRM Online

Contains the data that is needed to assign the specified record to a new owner (user or team) by changing the OwnerId attribute of the record.

Namespace: Microsoft.Crm.Sdk.Messages
Assembly: Microsoft.Crm.Sdk.Proxy (in Microsoft.Crm.Sdk.Proxy.dll)

Syntax

'Declaration
<DataContractAttribute(Namespace:="https://schemas.microsoft.com/crm/2011/Contracts")> _
Public NotInheritable Class AssignRequest
    Inherits OrganizationRequest
[DataContractAttribute(Namespace="https://schemas.microsoft.com/crm/2011/Contracts")] 
public sealed class AssignRequest : OrganizationRequest

Example

The following example shows how to use this message. For this sample to work correctly, you must be connected to the server to get an IOrganizationService interface. For the complete sample, see the link later in this topic.

// Create the Request Object and Set the Request Object's Properties
AssignRequest assign = new AssignRequest
    {
        Assignee = new EntityReference(SystemUser.EntityLogicalName,
            _otherUserId),
        Target = new EntityReference(Account.EntityLogicalName,
            _accountId)
    };


// Execute the Request
_service.Execute(assign);

Remarks

Message Availability

For this message to work, the caller must be connected to the server.

Usage

Pass an instance of this class to the Execute method, which returns an instance of the AssignResponse class.

Privileges and Access Rights

To perform this action, the caller must have privileges on the specified entity in the Target property and access rights on the specified record in the Target property. For a list of the required privileges, see Assign Privileges.

Notes for Callers

This action applies to the parent record and the associated records that have the same owner as the parent record. Therefore, when you assign the parent record to a new owner, only the associated records that have the same owner as the parent record are also assigned.

If the value of the Organization.ShareToPreviousOwnerOnAssign attribute is true, when a record is assigned to a new owner, it is shared with the previous owner with full rights. In this case, either the new owner or the previous owner can remove the relationship or lower the level of privileges that the previous owner has on the record.

For a description of how actions on a parent record affect child records, see Cascading Behavior.

Supported Entities

You can use this message to associate records of any two entities that participate in a relationship, including records for custom entities. You can find the default relationships listed in the Entity Metadata topic for each entity.

The following table shows the default entities that support this message. For the listed entities, the caller must be connected to the server for this message to be available.

Entity Availability

account

Server

annotation

Server

appointment

Server

campaign

Server

campaignactivity

Server

campaignresponse

Server

connection

Server

contact

Server

contract

Server

customeropportunityrole

Server

customerrelationship

Server

duplicaterule

Server

email

Server

emailserverprofile

Server

fax

Server

goal

Server

goalrollupquery

Server

importfile

Server

importmap

Server

incident

Server

incidentresolution

Server

invoice

Server

lead

Server

letter

Server

list

Server

mailbox

Server

mailmergetemplate

Server

opportunity

Server

opportunityclose

Server

orderclose

Server

phonecall

Server

processsession

Server

queue

Server

quote

Server

quoteclose

Server

recurringappointmentmaster

Server

report

Server

salesorder

Server

serviceappointment

Server

sharepointdocumentlocation

Server

sharepointsite

Server

task

Server

template

Server

userform

Server

userquery

Server

userqueryvisualization

Server

workflow

Server

Inheritance Hierarchy

System.Object
   Microsoft.Xrm.Sdk.OrganizationRequest
    Microsoft.Crm.Sdk.Messages.AssignRequest

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Server 2008, Windows Server 2012, Windows 7 (All Versions), Windows 8 (All Versions)

Target Platforms

Windows Server 2008, ,Windows Server 2012, ,Windows 7 (All Versions),

Change History

See Also

Reference

AssignRequest Members
Microsoft.Crm.Sdk.Messages Namespace
Actions on Entity Records
Entity Ownership
AssignResponse

Other Resources

Sample: Assign a Record to a New Owner
Sample: Assign Record to Team

Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.