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.

Namespace:   Microsoft.Xrm.Sdk.Messages
Assembly:  Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)

System.Object
  Microsoft.Xrm.Sdk.OrganizationRequest
    Microsoft.Xrm.Sdk.Messages.InsertStatusValueRequest

[DataContractAttribute(Namespace = "http://schemas.microsoft.com/xrm/2011/Contracts")]
public sealed class InsertStatusValueRequest : OrganizationRequest

NameDescription
System_CAPS_pubmethodInsertStatusValueRequest()

Initializes a new instance of the InsertStatusValueRequest class

NameDescription
System_CAPS_pubpropertyAttributeLogicalName

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

System_CAPS_pubpropertyDescription

Gets or sets a description for the option. Optional.

System_CAPS_pubpropertyEntityLogicalName

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

System_CAPS_pubpropertyExtensionData

Gets or sets the structure that contains extra data. Optional.(Inherited from OrganizationRequest.)

System_CAPS_pubpropertyItem[String]

Gets or sets the indexer for the Parameters collection.(Inherited from OrganizationRequest.)

System_CAPS_pubpropertyLabel

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

System_CAPS_pubpropertyOptionSetName

Reserved for future use. Optional.

System_CAPS_pubpropertyParameters

Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.(Inherited from OrganizationRequest.)

System_CAPS_pubpropertyRequestId

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

System_CAPS_pubpropertyRequestName

Gets or sets the name of the request. Required, but is supplied by derived classes.(Inherited from OrganizationRequest.)

System_CAPS_pubpropertySolutionUniqueName

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

System_CAPS_pubpropertyStateCode

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

System_CAPS_pubpropertyValue

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

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

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 InsertStatusValueResponse.

Privileges and Access Rights

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

Notes for Callers

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.



// 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)_serviceProxy.Execute(
    insertStatusValueRequest)).NewOptionValue;

Console.WriteLine("Created {0} with the value of {1}.",
    insertStatusValueRequest.Label.LocalizedLabels[0].Label,
    _insertedStatusValue);

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

Return to top

Microsoft Dynamics CRM 2016 and CRM Online

© 2016 Microsoft. All rights reserved. Copyright

Community Additions

ADD
Show: