CMSRecord
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
This class represents a Salesforce CMS record, exposing its:
id, see getID()type, see getType()attributes, see getAttributes()The attributes are key value pairs:
type.attribute_definitionsentriestype.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)| Property | Description |
|---|---|
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:
|
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.
| Method | Description |
|---|---|
| getAttributes() | Return the Salesforce CMS record attributes as key value pairs:
|
| 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
(read-only)Return the id of the Salesforce CMS record.
(read-only)Return the Salesforce CMS record attributes as key value pairs:
[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitionsentries
[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.
(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 : stringgetType().name : stringgetType().attribute_definitions : Map(see content/schema/attributedefinition.json)Return the Salesforce CMS record attributes as key value pairs:
[getType()](dw.experience.cms.CMSRecord.md#gettype).attribute_definitionsentries
[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:
Return the id of the Salesforce CMS record.
Returns:
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 : stringgetType().name : stringgetType().attribute_definitions : Map(see content/schema/attributedefinition.json)Returns: