AgentPanel Lightning Component

Pro and Enterprise editions only

Coveo for Salesforce 3 (May 2018)

The AgentPanel component allows you to present relevant articles to your agents directly from the Lightning console, while they are viewing a record.

It takes care of wrapping and including the correct scripts and different resource references needed to do so.

LightningInsightPanel

Usage

Simply reference it in your Lightning component as you would for any other Aura component, using the namespace prefix of the Coveo package.

<aura:component implements="force:hasRecordId,force:hasSObjectName,flexipage:availableForRecordHome" access="global">
  <CoveoV2:AgentPanel recordId="{!v.recordId}"
                      sObjectName="{!v.sObjectName}" />
</aura:component>

The recordId and sObjectName options on the AgentPanel component are needed so the panel can return results related to the currently viewed record. While removing them will still create a functional search page, it will not be able to return contextually relevant information.

Resources Included With This Component

This component includes the Coveo JavaScript Search Framework, the jQuery (latest 3.x.x version) and Underscore.js (latest 1.x.x version) libraries, and the Coveo for Salesforce specific assets.

Aura Event

This component offers the following event:

ErrorEvent

This error is fired when an error occurs with the component.

Options

This component offers the following options:

name

The name of the Visualforce component that should act as your search interface for your Lightning Insight Panel.

Default value is coveoLightningInsightPanel.

searchHub

The name of the search hub to enforce when authenticating a query with this search token, which can also be used in query pipeline condition statements.

This option should have the same value as name.

title

The title to show at the top of the component.

Default value is Search.

recordFields

A comma-separated list of record fields values to send in the query context.

The field name syntax should be constructed as such:

YourSalesforceObjectName_YourSalesforceFieldApiName

Default value is Case_Subject, Case_Description.

openResultsInSubTab

Whether the results should open in a sub tab when clicking on them.

Default value is false.

fullSearchComponent

The name of the component to open when clicking on the Full Search button.

It should follow the myNamespace:myComponentname format.

As of Coveo for Salesforce 3.16, it should follow the myNamespace__myComponentName format.

Leave this field blank to use the default search page.

debug

Whether to use the non-minified versions of the different resources.

Default value is false.

Recommended Articles