InsertStatusValueRequest Class
Definition
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
[System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/xrm/2011/Contracts")]
public sealed class InsertStatusValueRequest : Microsoft.Xrm.Sdk.OrganizationRequest
[<System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/xrm/2011/Contracts")>]
type InsertStatusValueRequest = class
inherit OrganizationRequest
Public NotInheritable Class InsertStatusValueRequest
Inherits OrganizationRequest
- Inheritance
- 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.
// 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);
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
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(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
Constructors
InsertStatusValueRequest() |
Initializes a new instance of the InsertStatusValueRequest class |
Properties
AttributeLogicalName |
Gets or sets the logical name of the status attribute. Optional. |
Description |
Gets or sets a description for the option. Optional. |
EntityLogicalName |
Gets or sets the logical name of the entity that contains the attribute. Optional. |
ExtensionData |
Gets or sets the structure that contains extra data. Optional. (Inherited from OrganizationRequest) |
Item[String] |
Gets or sets the indexer for the |
Label |
Gets or sets the label for the new status. Required. |
OptionSetName |
Reserved for future use. Optional. |
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 an asynchronous operation (system job). Optional. (Inherited from OrganizationRequest) |
RequestName |
Gets or sets the name of the request. Required, but is supplied by derived classes. (Inherited from OrganizationRequest) |
SolutionUniqueName |
Gets or sets the solution that this attribute should be added to. Optional. |
StateCode |
Gets or sets the state code for the new status. Required. |
Value |
Gets or sets the value for the new status. Optional. |