CloneContractRequest CloneContractRequest CloneContractRequest CloneContractRequest Class

Definition

Contains the data that is needed to copy an existing contract and its line items.

For the Web API use the CloneContract Action.

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

Examples



// Create the first clone of the contract.
var cloneRequest = new CloneContractRequest()
{
    ContractId = _contractId,
    IncludeCanceledLines = false
};

CloneContractResponse cloneResponse =(CloneContractResponse)svc.Execute(cloneRequest);
_firstCloneId = ((Contract)cloneResponse.Entity).ContractId.Value;

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.

Service#CloneContract

Remarks

Message Availability

This message works regardless whether the caller is connected to the server or offline.

Usage

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

Privileges and Access Rights

To perform this action, the caller must have privileges on the Contract entity and access rights on the record specified in the ContractId property. For a complete list of the required privileges, see CloneContract message privileges.

Notes for Callers

By default the caller will become the owner for the new record. For this to work, the caller must have both Create and Read privileges for the contract entity. For more information, see Privileges by entity. Alternatively, you can set the ownerid property to the ID of another user.

Constructors

CloneContractRequest() CloneContractRequest() CloneContractRequest() CloneContractRequest()

Initializes a new instance of the CloneContractRequest class.

Properties

ContractId ContractId ContractId ContractId

Gets or sets the ID of the contract to be copied. Required.

ExtensionData ExtensionData ExtensionData ExtensionData

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

(Inherited from OrganizationRequest)
IncludeCanceledLines IncludeCanceledLines IncludeCanceledLines IncludeCanceledLines

Gets or sets a value that indicates whether the canceled line items of the originating contract are to be included in the copy (clone). Required.

Item[String] Item[String] Item[String] Item[String]

Gets or sets the indexer for the Parameters collection.

(Inherited from OrganizationRequest)
Parameters Parameters Parameters Parameters

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

(Inherited from OrganizationRequest)
RequestId RequestId RequestId RequestId

Gets or sets the ID of an asynchronous operation (system job). Optional.

(Inherited from OrganizationRequest)
RequestName RequestName RequestName RequestName

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

(Inherited from OrganizationRequest)

Applies to

See also