Attributes (Client API reference)

Applies to Dynamics 365 (online), version 9.0

Attributes contain data in the Customer Engagement form or grids. Use the formContext.data.entity.attributes collection or the formContext.getAttribute shortcut method to access a collection of attributes. For more information about collections, see Collections (Client API reference).

To access an attribute within the collection, you pass either the name (string) or the index value (number) of the attribute as an argument to the method. For example: formContext.getAttribute(arg)

Attributes are categorized by type. You can determine the type of an attribute by using the getAttributeType method. Certain attribute methods are only available for specific types of attributes.

This topic provides information about the methods available per attribute type.

All attribute types

Boolean attribute type

In addition to the methods available for all attribute types as explained ealier, the following method is available only for the boolean attribute:

Lookup attribute type

In addition to the methods available for all attribute types as explained ealier, the following method is available only for the lookup attribute:

MultiSelectOptionSet and OptionSet attribute types

In addition to the methods available for all attribute types as explained ealier, the following methods are available only for the multiselectoption and optionset attributes:

Number attribute type (decimal, double, integer, money)

The following methods are available only for the decimal, double, and integer attributes:

String attribute type

In addition to the methods available for all attribute types as explained ealier, the following method is available only for the string attribute:

Composite attributes

Understand Xrm object model

Controls (Client API reference)