Templates Class

The Templates class provides methods for retrieving CRM Analytics template collections, individual templates, and template configurations.

Wave

Use Templates and its associated class Wave.TemplatesSearchOptions to get CRM Analytics template information.

This code sample declares a method that returns a list of the template names.

Adding the @AuraEnabled annotation allows Lightning Web Components to access Templates methods directly.

For example, in the lwc.js file:

The following are methods for Templates.

  • getTemplate(templateIdOrApiName)

    Gets a CRM Analytics template by the specified ID or API name. The returned template is a map of the template JSON attributes as name/value pairs.

  • getTemplateConfig(templateIdOrApiName)

    Gets the CRM Analytics template configuration by the specified ID or API name. The returned template configuration is a map of the JSON attributes as name/value pairs.

  • getTemplates(options)

    Get a filtered collection of CRM Analytics templates using search options.

  • getTemplates()

    Gets all CRM Analytics templates.

Gets a CRM Analytics template by the specified ID or API name. The returned template is a map of the template JSON attributes as name/value pairs.

public static Map<String,Object> getTemplate(String templateIdOrApiName)

  • templateIdOrApiName:

    Type: String

    The template ID or API name of the template to retrieve.

Type: Map<String,Object>

A map of the template JSON attribute name/value pairs, where the name is a string with an object value. For attributes details, see TemplateRepresentation.

Here, templateId is a placeholder value.

Gets the CRM Analytics template configuration by the specified ID or API name. The returned template configuration is a map of the JSON attributes as name/value pairs.

public static Map<String,Object> getTemplateConfig(String templateIdOrApiName)

  • templateIdOrApiName:

    Type: String

    The template ID or developer name to retrieve the template configuration for.

Type: Map<String,Object>

A map of template configuration JSON attribute names and the object values. For attribute details, see TemplateConfigurationRepresentation.

Here, templateId is a placeholder value.

Get a filtered collection of CRM Analytics templates using search options.

public static Map<String,Object> getTemplates(Wave.TemplatesSearchOptions options)

Type: Map<String,Object>

A map of template names and the template object values. For template collection details, see TemplateCollectionRepresentation.

Gets all CRM Analytics templates.

public static Map<String,Object> getTemplates()

Type: Map<String,Object>

A map of template names and the template object values. For template collection details, see TemplateCollectionRepresentation.