InsertStatusValueRequest InsertStatusValueRequest InsertStatusValueRequest InsertStatusValueRequest Class


Contains the data that is needed to insert a new option into a StatusAttributeMetadata attribute.

For the Web API use the InsertStatusValue Action.

public ref class InsertStatusValueRequest sealed : Microsoft::Xrm::Sdk::OrganizationRequest
public sealed class InsertStatusValueRequest : Microsoft.Xrm.Sdk.OrganizationRequest
type InsertStatusValueRequest = class
    inherit OrganizationRequest
Public NotInheritable Class InsertStatusValueRequest
Inherits OrganizationRequest


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.

// Use InsertStatusValueRequest message to insert a new status 
// in an existing status attribute. 
// Create the request.
InsertStatusValueRequest insertStatusValueRequest =
    new InsertStatusValueRequest
    AttributeLogicalName = "statuscode",
    EntityLogicalName = Contact.EntityLogicalName,
    Label = new Label("Dormant", _languageCode),
    StateCode = 0

// Execute the request and store newly inserted value // for cleanup, used later part of this sample. _insertedStatusValue = ((InsertStatusValueResponse)svc.Execute( insertStatusValueRequest)).NewOptionValue; Console.WriteLine("Created {0} with the value of {1}.", insertStatusValueRequest.Label.LocalizedLabels[0].Label, _insertedStatusValue);


Message Availability

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


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

Privileges and Access Rights

To perform this action, the caller must have privileges listed in InsertStatusValue message privileges.

Notes for Callers


InsertStatusValueRequest() InsertStatusValueRequest() InsertStatusValueRequest() InsertStatusValueRequest()

Initializes a new instance of the InsertStatusValueRequest class


AttributeLogicalName AttributeLogicalName AttributeLogicalName AttributeLogicalName

Gets or sets the logical name of the status attribute. Optional.

Description Description Description Description

Gets or sets a description for the option. Optional.

EntityLogicalName EntityLogicalName EntityLogicalName EntityLogicalName

Gets or sets the logical name of the entity that contains the attribute. Optional.

ExtensionData ExtensionData ExtensionData ExtensionData

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

(Inherited from OrganizationRequest)
Item[String] Item[String] Item[String] Item[String]

Gets or sets the indexer for the Parameters collection.

(Inherited from OrganizationRequest)
Label Label Label Label

Gets or sets the label for the new status. Required.

OptionSetName OptionSetName OptionSetName OptionSetName

Reserved for future use. Optional.

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)
SolutionUniqueName SolutionUniqueName SolutionUniqueName SolutionUniqueName

Gets or sets the solution that this attribute should be added to. Optional.

StateCode StateCode StateCode StateCode

Gets or sets the state code for the new status. Required.

Value Value Value Value

Gets or sets the value for the new status. Optional.

Applies to