CreateRequest Class

Definition

Contains the data that is needed to create a record.

public ref class CreateRequest sealed : Microsoft::Xrm::Sdk::OrganizationRequest
[System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/xrm/2011/Contracts")]
public sealed class CreateRequest : Microsoft.Xrm.Sdk.OrganizationRequest
[<System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/xrm/2011/Contracts")>]
type CreateRequest = class
    inherit OrganizationRequest
Public NotInheritable Class CreateRequest
Inherits OrganizationRequest
Inheritance
CreateRequest
Attributes

Examples

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.

Remarks

Usage

Pass an instance of this class to the Execute(OrganizationRequest) method, which returns an instance of the CreateResponse class.

This message supports one or more optional parameters. For more information, see Use messages (request and response classes) with the Execute method.

Privileges and Access Rights

To perform this action, the caller must have privileges on the specified entity in the entity parameter. For a list of the required privileges, see Create message privileges.

Notes for Callers

This message creates a record with related records in one transaction. For a less complex method that creates a single record, use the Create(Entity) method.

By default, the caller becomes the owner for the new record. For this message to work, the caller must have both Create and Read privileges for the entity. For more information, see Privileges by entity. Or you can set the ownerid attribute for the record to the ID of another user.

Supported Entities

You can use this method to create any record of an entity (includes custom entities) that supports the CreateRequest message.

Constructors

CreateRequest()

Initializes a new instance of the CreateRequest class.

Properties

ExtensionData

Gets or sets the structure that contains extra data. Optional.

(Inherited from OrganizationRequest)
Item[String]

Gets or sets the indexer for the Parameters collection.

(Inherited from OrganizationRequest)
Parameters

Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
RequestId

Gets or sets the ID of the request. Optional.

(Inherited from OrganizationRequest)
RequestName

Gets or sets the name of the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
Target

Gets or sets an instance of an entity that you can use to create a new record. Required.

Applies to

See also