getEntityMetadata (Client API)

Returns table definitions for the specified table.

Syntax

Xrm.Utility.getEntityMetadata(entityName,attributes).then(successCallback, errorCallback)

Parameters

Name Type Required Description
entityName String Yes The logical name of the table.
attributes array of strings No The columns to get definitions for.
successCallback function No A function to call when the table definitions are returned.
errorCallback function No A function to call when the operation fails.

Returns

Type: Object

Description: An object containing the table definitions information with the following values.

Name Type Description
ActivityTypeMask Number Whether a custom activity should appear in the activity menus in the Web application. 0 indicates that the custom activity doesn't appear; 1 indicates that it does appear.
AutoRouteToOwnerQueue Boolean Indicates whether to automatically move records to the owner's default queue when a record of this type is created or assigned.
CanEnableSyncToExternalSearchIndex Boolean For internal use only.
CanTriggerWorkflow Boolean Indicates whether the table can trigger a workflow process.
Description String Description for the table.
DisplayCollectionName String Plural display name for the table.
DisplayName String Display name for the table.
EnforceStateTransitions Boolean Indicates whether the table will enforce custom state transitions.
EntityColor String The hexadecimal code to represent the color to be used for this table in the application.
EntitySetName String The name of the Web API table set for this table.
HasActivities Boolean Indicates whether activities are associated with this table.
IsActivity Boolean Indicates whether the table is an activity.
IsActivityParty Boolean Indicates whether the email messages can be sent to an email address stored in a record of this type.
IsBusinessProcessEnabled Boolean Indicates whether the table is enabled for business process flows.
IsBPFEntity Boolean Indicates whether the table is a business process flow table.
IsChildEntity Boolean Indicates whether the table is a child table.
IsConnectionsEnabled Boolean Indicates whether connections are enabled for this table.
IsCustomEntity Boolean Indicates whether the table is a custom table.
IsCustomizable Boolean Indicates whether the table is customizable.
IsDocumentManagementEnabled Boolean Indicates whether document management is enabled.
IsDocumentRecommendationsEnabled Boolean Indicates whether the document recommendations is enabled.
IsDuplicateDetectionEnabled Boolean Indicates whether duplicate detection is enabled.
IsEnabledForCharts Boolean Indicates whether charts are enabled.
IsImportable Boolean Indicates whether the table can be imported using the Import Wizard.
IsInteractionCentricEnabled Boolean Indicates the table is enabled for interactive experience.
IsKnowledgeManagementEnabled Boolean Indicates whether knowledge management is enabled for the table.
IsMailMergeEnabled Boolean Indicates whether mail merge is enabled for this table.
IsManaged Boolean Indicates whether the table is part of a managed solution.
IsOneNoteIntegrationEnabled Boolean Indicates whether OneNote integration is enabled for the table.
IsOptimisticConcurrencyEnabled Boolean Indicates whether optimistic concurrency is enabled for the table.
IsQuickCreateEnabled Boolean Indicates whether the table is enabled for quick create forms.
IsStateModelAware Boolean Indicates whether the table supports setting custom state transitions.
IsValidForAdvancedFind Boolean Indicates whether the table is will be shown in Advanced Find.
IsVisibleInMobileClient Boolean Indicates whether Microsoft Dynamics 365 for tablets users can see data for this table.
IsEnabledInUnifiedInterface Boolean Indicates whether the table is enabled for Unified Interface.
LogicalCollectionName String The logical collection name.
LogicalName String The logical name for the table.
ObjectTypeCode Number The table type code.
OwnershipType String The ownership type for the table: "UserOwned" or "OrganizationOwned".
PrimaryIdAttribute String The name of the column that is the primary id for the table.
PrimaryImageAttribute String The name of the primary image column for a table.
PrimaryNameAttribute String The name of the primary column for a table.
Privileges Array of objects The privilege definitions for the table where *each* object contains the following values to define the security privilege for access to a table:
  • CanBeBasic: Boolean. Whether the privilege can be basic access level.
  • CanBeDeep: Boolean. Whether the privilege can be deep access level.
  • CanBeEntityReference: Boolean. Whether the privilege for an external party can be basic access level.
  • CanBeGlobal: Boolean. Whether the privilege can be global access level.
  • CanBeLocal: Boolean. Whether the privilege can be local access level.
  • CanBeParentEntityReference: Boolean. Whether the privilege for an external party can be parent access level.
  • Name: String. The name of the privilege.
  • PrivilegeId: String. The ID of the privilege.
  • PrivilegeType: Number. The type of privilege, which is one of the following:
    • 0: None
    • 1: Create
    • 2: Read
    • 3: Write
    • 4: Delete
    • 5: Assign
    • 6: Share
    • 7: Append
    • 8: AppendTo
Attributes Collection A collection of column definitions objects. The object returned depends on the type of column definitions.

Column definitions for the base type
An object returned with the following properties:

  • AttributeType: Number. Type of a column. For a list of column type values, see AttributeTypeCode
  • DisplayName: String. Display name for the column.
  • EntityLogicalName: String. Logical name of the table that contains the column.
  • LogicalName: String. Logical name for the column.

Column definitions for the boolean type
An object returned with the following properties in addition to the base column definitions type properties:

  • DefaultFormValue: Boolean. Default value for a Yes/No column.
  • OptionSet: Object. Options for the boolean column where each option is a key:value pair.

Column definitions for the enum type
An object returned with the following properties in addition to the base column definitions type properties:

  • OptionSet: Object. Options for the column where each option is a key:value pair.

Column definitions for the choices type
An object returned with the following properties in addition to the base column definitions type properties:

  • DefaultFormValue: Number. Default form value for the column.
  • OptionSet: Object. Options for the column where each option is a key:value pair.

Column definitions for the state type
An object returned with the following properties in addition to the base column definitions type properties:

  • OptionSet: Object. Options for the column where each option is a key:value pair.

The object also contains the following methods:

  • getDefaultStatus(arg): Returns the default status (number) based on the passed in state value for a table. For default state and status values for a table, see table definitions information of the table in table/entity reference.
  • getStatusValuesForState(arg): Returns possible status values (array of numbers) for a specified state value. For state and status values for a table, see table definitions information of the table in table/entity reference.

Column definitions for the status type
An object returned with the following properties in addition to the base column definitions type properties:

  • OptionSet: Object. Options for the column where each option is a key:value pair.

The object also contains the following method:

  • getState(arg): Returns the state value (number) for the specified status value (number). For default state and status values for a table, see table definitions information of the table in table/entity reference.

Xrm.Utility