EntityMetadata.ObjectTypeCode Property


Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Gets the entity type code.

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


public Nullable<int> ObjectTypeCode { get; internal set; }
Public Property ObjectTypeCode As Nullable(Of Integer)
    Friend Set
End Property

Property Value

Type: System.Nullable<Int32>

Type: Nullable<Int32>
The entity type code.



Always use the entity schema name (SchemaName) to refer to a custom entity in code and queries. Do not use the object type code (also referred to as entity type) code because tis integer value varies for custom entities in different organizations.

See Also

EntityMetadata Class
Microsoft.Xrm.Sdk.Metadata Namespace
Best practices for developing with Microsoft Dynamics 365

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright