Creating a Custom Coveo Box Inside the Salesforce Console for a Coveo Insight Panel Classic Component

Salesforce Classic

Pro and Enterprise editions only

Coveo for Salesforce offers a way to create a completely customizable box to be used inside the Salesforce console.

Here are the steps required to achieve this.

There’s an alternative way of doing this, which doesn’t require as much configuration (see Integrating a Coveo Insight Panel Classic Component and Creating a Custom Coveo Insight Panel Classic Component).

Create a New Visualforce Page

Create a new page inside Salesforce with the following basic markup.

MyCustomBox

<apex:page standardController="Case" cache="false" showheader="false" sidebar="false" standardstylesheets="false">
    Hello world !
</apex:page>
  • standardController: This is the standard Salesforce controller that you need to reference in order to get the current record id. In this case, this is a custom Box that would be used for Case objects.

    For other types of objects, you could of course reference any other controller, such as Contact , Account, Lead, Opportunity, etc.

  • cache: false. Since you’re developing, you don’t want to cache the page.

  • showHeader: false. Setting this to true would display the standard Salesforce header in the page.

  • sidebar: false. Setting this to true would display the standard Salesforce sidebar in the page.

  • standardstylesheets: false. Setting this to true would include the standard Salesforce CSS in the page.

Edit the Layout of the Console to Display the Page

You then need to edit the layout of your console in order to display your Visualforce page (see the Salesforce article Add Console Components to Page Layouts).

You can then reference your page as such:

  • style: Accordion. This works very well if you want to have many pages/component in your layout. You can stack them all independently.

  • width: You can set it as wide as you want. However, the wider you set it, the more information you will eventually be able to display.

  • type: Choose Visualforce page, which is what you just created.

  • component: Enter the name of your Visualforce page, with a custom label.

Verify Your Layout

Normally, with the page you just created, you should get something that looks like this:

Create a Standard Coveo Box Component

Edit your new page to include the Box Visualforce Component.

<apex:page standardController="Case" cache="false" showheader="false" sidebar="false" standardstylesheets="false">
    <CoveoV2:Box recordId="{!id}" debug="true"/>
</apex:page>
  • recordId: The record id of the current object in the page. The Box component needs this id to create its query and initialize itself.

  • debug: True. This includes the debugging version of the resources in the page (Non-minified).

    Don’t forget to remove this attribute before going to production to speedup loading time.

You should then be able to see something similar to this:

What’s Next?

Since the default Full Search page is linked to a Visualforce page, when you want to customize your Full Search component, you should create a new page including your custom code (see Creating a Custom Visualforce Search page).