Allows you to load any CRM entity by ID. If the entity exists, a entity object will be returned. If an entity with the given ID is not found, null will be returned.

{% assign account = entities.account['936DA01F-9ABD-4d9d-80C7-02AF85C822A8'] %}
{% if account %}
{{ account.name }} ({{ account.statecode.label }})
{% endif %}

{% assign entity_logical_name = 'contact' %}
{% assign contact = entities[entity_logical_name][request.params.contactid] %}
{% if contact %}
{{ contact.fullname }} ({{ contact.parentcustomerid.name }})
{% endif %}

Entity

An entity object provides access to the attributes of a CRM entity record.

AttributeDescription
id

The GUID ID of the entity, as a string.

e.g. 936DA01F-9ABD-4d9d-80C7-02AF85C822A8

logical_name

The CRM logical name of the entity.

e.g. adx_webpage

notes

Loads any notes (annotation) associated with the entity, ordered from oldest to newest (createdon). Notes are returned as note objects.

permissions

Loads Entity Permission assertion results for the entity. Results are returned as a permissions object.

url

Returns the Adxstudio Portals content management system URL path for the entity. If the entity has no valid URL in the current website, returns null.

Generally, this will only return a value for certain entity types that have been integrated into the Adxstudio Portals CMS (adx_webpage, adx_event, etc.), unless you have customized the URL Provider in your application.

[attribute or relationship name]

You can access any attribute of the CRM entity by logical name.

{{ entity.createdon }}

{% assign attribute_name = 'name' %}
{{ entity[attribute_name] }}

The values of most entity attributes map directly to Liquid types: Two Option fields map to booleans, text fields to strings, numeric/currency fields to numbers, date/time fields to date objects. But, some attribute types are returned as objects:

You can also load any related entities by relationship schema name.

{{ page.adx_webpage_entitylist.adx_name }}

In the case that a relationship is reflexive (i.e. self-referential), a reflexive relationship object will be returned. (Otherwise, the desired result would be ambiguous.)

{{ page.adx_webpage_webpage.referencing.adx_name }}

  Loading large numbers of related entities, or accessing large numbers of relationships in a single template, can have a negative impact on template rendering performance. Avoid loading related entities for each item in an array, within a loop.

Where possible, prefer use of the entitylist and entityview tags to load collections of entities.

Entity Reference

Lookup attribute values are returned as entity reference objects, with the following attributes.

AttributeDescription
id

The GUID ID of the referenced entity, as a string.

e.g. 936DA01F-9ABD-4d9d-80C7-02AF85C822A8

logical_name

The CRM logical name of the referenced entity.

e.g. adx_webpage

name

The primary name attribute of the referenced entity.

Note

A note is an entity object that provides access to the attributes and relationships of an annotation record. In addition to all the attributes of an entity object, a note has the following additional attributes.

AttributeDescription
documentbody

Loads the documentbody attribute of the note annotation record, as a Base64-encoded string. As the content of this attribute may be large, it is not loaded with the rest of the note attributes, and only loaded on demand.

  Use of the documentbody attribute could have a negative impact on template rendering performance, and should be done with caution.

Use the url attribute to provide a link to the note attachment instead, if possible.

url

Returns the URL path for the built-in portal annotation attachment handler. If the user has permission, and the note has an attached file, a request to this URL will download the note file attachment.

Option Set Value

Option Set/Picklist attribute values are returned as entity reference objects, with the following attributes.

AttributeDescription
label

The localized label of the option set/picklist attribute value.

e.g. Active

value

The integer value of the option set/picklist attribute value.

e.g. 0

Entity Permissions

The Entity Permissions object provides access to aggregated permission assertion results for an entity.

AttributeDescription
can_append

Returns true if the current user has permission to append records to relationships of this record. Returns false otherwise.

can_append_to

Returns true if the current user has permission to append this record to a relationship of another entity. Returns false otherwise.

can_create

Returns true if the current user has permission to create new records of this entity type. Returns false otherwise.

can_delete

Returns true if the current user has permission to delete this record. Returns false otherwise.

can_read

Returns true if the current user has permission to read this record. Returns false otherwise.

can_write

Returns true if the current user has permission to update this record. Returns false otherwise.

rules_exist

Returns true if the permission results represented by this object are the result of explicitly-defined permission rules. Returns false if they are the default results in the absence of explicitly-defined permissions.

Reflexive Relationship

Attempts to load reflexive (i.e. self-referential) relationships on entities are returned as objects with the following attributes.

AttributeDescription
is_reflexive

Returns true. Can be used to test if an object returned by a relationship is a reflexive relationship object.

referenced

Returns an array of referenced entities for the given relationship.

referencing

Returns a referencing entity for the given relationship. Returns null if no referencing entity exists.

If the relationship is many-to-many (N:N), returns an array of referencing entities.