CRM Analytics in Apex

Build and execute queries and retrieve lens and template data using CRM Analytics Apex classes and methods.

CRM Analytics in Apex currently consists of the executeQuery method, the Wave.QueryBuilder class, and the Wave.Lenses class.

ConnectApi.Wave.executeQuery

Use the executeQuery function (exposed through the ConnectApi namespace) to pass a SAQL query from an Apex page to CRM Analytics, and get a response in the form of JSON.

Wave.QueryBuilder

The QueryBuilder class is the most convenient, preferred, and safest way to construct a SAQL query string for execution.

Wave.Lenses

Retrieve a collection of CRM Analytics lens assets and describe a single lens asset.

Wave.Templates

Retrieve a collection of CRM Analytics templates, describe a single template and template configuration.

For more information on using Apex, see the Apex Developer Guide.