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.
-
Use the
Lensesclass to retrieve a collection of CRM Analytics lens assets and to describe a single lens asset. -
Query your data in CRM Analytics from any Apex class. Construct well-formed queries using the query builder.
-
CRM Analytics Apex QueryBuilder Examples
Build simple or complex SAQL queries using QueryBuilder.
-
Use the
Templatesclass to retrieve a collection of CRM Analytics templates, describe a single template and template configuration.