Retrieves information about the attributes of a Microsoft Dynamics CRM entity. This information includes the logical name, display name, and type of the attribute.
If an attribute contains a Boolean, status, picklist, or state value, the function returns a comma-separated list of option and display values.
Availability
<table> <tr> <td>Marketing Cloud Engagement</td> <td>✅ Yes</td> </tr> <tr> <td>Marketing Cloud Next</td> <td>❌ No</td> </tr> </table>Syntax
DescribeMscrmEntityAttributes(entityName)
The DescribeMscrmEntityAttributes() function has one parameter:
entityName(string): Required. The name of the Microsoft Dynamics CRM entity to retrieve attributes from.
Usage
This example retrieves information about the attributes of the Lead entity in Microsoft Dynamics CRM.
%%[ Var @fields_rs Set @fields_rs = DescribeMscrmEntityAttributes('Lead') ]%%
<table>
<tr>
<th>Field Name</th>
<th>Display Name</th>
<th>Type</th>
<th>Required</th>
<th>Options</th>
</tr>
%%[
Var @field_name, @field_displayname, @counter, @field_type, @field_required, @field_options
For @counter = 1 to rowcount(@fields_rs) do
Set @field_name = Field(row(@fields_rs,@counter), 'Name')
Set @field_displayname = Field(row(@fields_rs,@counter), 'DisplayName')
Set @field_type = Field(row(@fields_rs,@counter), 'Type')
Set @field_required = Field(row(@fields_rs,@counter), 'Required')
Set @field_options = Field(row(@fields_rs,@counter), 'Options')
]%%
<tr>
<td>%%=v(@field_name)=%%</td>
<td>%%=v(@field_displayname)=%%</td>
<td>%%=v(@field_type)=%%</td>
<td>%%=v(@field_required)=%%</td>
<td>%%=v(@field_options)=%%</td>
</tr>
%%[ Next @counter ]%%
</table>
The example outputs a table that provides the field name, display name, field type, required status, and field options for each attribute in the Lead entity.