Class CMSRecord

This class represents a Salesforce CMS record, exposing its:

The attributes are key value pairs:

  • the key being the attribute id as given in the type.attribute_definitionsentries
  • the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the type.attribute_definitionsentries (similar to how ComponentScriptContext.getContent()exposes the raw attribute value of a Component.getAttribute(String)in shape of a DWScript API object based on the attribute type)
PropertyDescription
ID: String (read-only)Return the id of the Salesforce CMS record.
attributes: Map (read-only)Return the Salesforce CMS record attributes as key value pairs:
  • the key being the attribute id as given in the [getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions entries
  • the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the [getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions entries (similar to how ComponentScriptContext.getContent() exposes the raw attribute value of a Component.getAttribute(String) in shape of a DWScript API object based on the attribute type)
The attributes are also conveniently accessible through named property support.
type: Map (read-only)Return the type of the Salesforce CMS record sufficing the content/schema/cmsrecord.json#/definitions/cms_content_type schema.

This class does not have a constructor, so you cannot create it directly.

MethodDescription
getAttributes()Return the Salesforce CMS record attributes as key value pairs:
  • the key being the attribute id as given in the [getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions entries
  • the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the [getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitions entries (similar to how ComponentScriptContext.getContent() exposes the raw attribute value of a Component.getAttribute(String) in shape of a DWScript API object based on the attribute type)
The attributes are also conveniently accessible through named property support.
getID()Return the id of the Salesforce CMS record.
getType()Return the type of the Salesforce CMS record sufficing the content/schema/cmsrecord.json#/definitions/cms_content_type schema.

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

ID: String (read-only)

Return the id of the Salesforce CMS record.


attributes: Map (read-only)

Return the Salesforce CMS record attributes as key value pairs:

  • the key being the attribute id as given in the [getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitionsentries
  • the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the [getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitionsentries (similar to how ComponentScriptContext.getContent()exposes the raw attribute value of a Component.getAttribute(String)in shape of a DWScript API object based on the attribute type)

The attributes are also conveniently accessible through named property support. That means if myCmsRecord.getAttributes().get('foo') yields value 'bar', then myCmsRecord.foo will give the same results.


type: Map (read-only)

Return the type of the Salesforce CMS record sufficing the content/schema/cmsrecord.json#/definitions/cms_content_type schema. Properties can be accessed accordingly:

  • getType().id : string
  • getType().name : string
  • getType().attribute_definitions : Map(see content/schema/attributedefinition.json)

getAttributes(): Map

Return the Salesforce CMS record attributes as key value pairs:

  • the key being the attribute id as given in the [getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitionsentries
  • the value being a DWScript API object resolved from the raw attribute value based on the attribute type as given in the [getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitionsentries (similar to how ComponentScriptContext.getContent()exposes the raw attribute value of a Component.getAttribute(String)in shape of a DWScript API object based on the attribute type)

The attributes are also conveniently accessible through named property support. That means if myCmsRecord.getAttributes().get('foo') yields value 'bar', then myCmsRecord.foo will give the same results.

Returns:

  • the cms record attributes

getID(): String

Return the id of the Salesforce CMS record.

Returns:

  • the id of the Salesforce CMS record

getType(): Map

Return the type of the Salesforce CMS record sufficing the content/schema/cmsrecord.json#/definitions/cms_content_type schema. Properties can be accessed accordingly:

  • getType().id : string
  • getType().name : string
  • getType().attribute_definitions : Map(see content/schema/attributedefinition.json)

Returns:

  • the type of the cms record