CreateAttributeRequest Class
Updated: November 29, 2016
Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online
Contains the data that is needed to create a new attribute, and optionally, to add it to a specified unmanaged solution.
Assembly: Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)
| Name | Description | |
|---|---|---|
![]() | CreateAttributeRequest | Initializes a new instance of the CreateAttributeRequest class. |
| Name | Description | |
|---|---|---|
![]() | Gets or sets the definition of the attribute type that you want to create. Required. | |
![]() | Gets or sets the name of the entity for which you want to create an attribute. Required. | |
![]() | Gets or sets the structure that contains extra data. Optional.(Inherited from OrganizationRequest.) | |
![]() | Gets or sets the indexer for the Parameters collection.(Inherited from OrganizationRequest.) | |
![]() | Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.(Inherited from OrganizationRequest.) | |
![]() | Gets or sets the ID of an asynchronous operation (system job). Optional. (Inherited from OrganizationRequest.) | |
![]() | Gets or sets the name of the request. Required, but is supplied by derived classes.(Inherited from OrganizationRequest.) | |
![]() | Gets or sets the name of the unmanaged solution to which you want to add this attribute. Optional. |
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 the CreateAttributeResponse class.
Privileges and Access Rights
To perform this action, the caller must have the required privileges, as listed in CreateAttribute message privileges.
Notes for Callers
This message cannot be used to create a LookupAttributeMetadata attribute or a customer lookup attribute. Use the CreateOneToManyRequest message to create a lookup attribute and the CreateCustomerRelationshipsRequest message to create a customer lookup attribute.
Supported Entities
You can only add attributes to customizable entities where the managed property is true.
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.
This code defines the AttributeMetadata for a number of different types of attributes and adds them to a List<AttributeMetadata>. At the end of the code, the CreateAttributeRequest class prepares the request, and the attribute is created by using the Execute method.
This code sample assumes that the current customization prefix is ‘new’ because that is the default customization prefix for the organization solution publisher. You should use the customization prefix for the solution publisher that makes sense for the solution context in which you work.
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Microsoft Dynamics 365
© 2016 Microsoft. All rights reserved. Copyright

