--- title: Integrate useful Coveo for Salesforce features slug: latest-custom-ip-useful-coveo-for-salesforce-features canonical_url: https://docs.coveo.com/en/quantic/latest/usage/custom-ip-useful-coveo-for-salesforce-features/ collection: quantic source_format: adoc --- # Integrate useful Coveo for Salesforce features Coveo offers a [Hosted Insight Panel solution](https://docs.coveo.com/en/m7ak9250/) that provides a seamless, low-code way to display contextual recommendations and search results related to Salesforce records, helping service agents quickly access relevant content. For many customers, this out-of-the-box solution is sufficient. However, some organizations need greater flexibility—such as full control over rendering logic, advanced UI customization, or deeper integration with Salesforce records—than what the Hosted Insight Panel offers. In these cases, [creating a custom Insight Panel](https://docs.coveo.com/en/quantic/latest/usage/custom-insight-panels/) with [Quantic components](https://docs.coveo.com/en/quantic/latest/reference/insight-panel-components/) is the recommended approach. This article builds on the foundation of a custom [Insight Panel](https://docs.coveo.com/en/2898/) and explains how to extend it with advanced features, including: * [Integrating a hosted search page](#enable-advanced-search-with-the-hosted-search-page) for a full-screen search experience. * [Displaying and managing attached results on record pages](#attached-results-component), so service agents can easily access relevant Knowledge articles, similar cases, or internal resources. * [Adding AI-generated answers](#generated-answers) to provide [contextual responses based on the case or search query](https://docs.coveo.com/en/n9de0370/). ## Enable advanced search with the hosted search page The Coveo hosted search page provides a full-screen search interface directly from Salesforce, enabling service agents to perform detailed searches, filter results, and explore content in depth. While the Insight Panel provides quick, contextual results in a compact format, some scenarios require more space and functionality. Using the hosted search page is especially useful when service agents need more space to browse results, refine queries, or perform advanced searches that go beyond the compact view of the Insight Panel. ### Prerequisites * [Create a custom Insight Panel](https://docs.coveo.com/en/quantic/latest/usage/custom-insight-panels) with Coveo for Salesforce v4 or later. * [Integrate a Coveo hosted search page in a Lightning Console app](https://docs.coveo.com/en/o4b80259/) to open in a new Lightning Console tab. * Access to the [Lightning Console app](https://help.salesforce.com/s/articleView?id=service.console_lex_access.htm&type=5). * Familiarity with [Salesforce Lightning navigation](https://developer.salesforce.com/docs/component-library/bundle/lightning-navigation/documentation). ### Add a button to open the hosted search page You can add a button that lets service agents open the Coveo hosted search page in a new console tab. This allows service agents to quickly switch from the compact Insight Panel view to a full-screen search experience without losing context. See [lightning-navigation](https://developer.salesforce.com/docs/component-library/bundle/lightning-navigation/documentation) for details on how to work directly with the lightning navigation to achieve this. Add this functionality to effectively replicate the `insightFullSearch` feature that's available out of the box in the Hosted Insight Panel. For more details on the built-in feature, see [Insight Full Search in the Hosted Insight Panel](https://docs.coveo.com/en/m7ed8015/coveo-for-salesforce/integrate-a-coveo-hosted-insight-panel-component#insight-full-search). ## Attached results component The Coveo Attached Results component is a powerful feature that enhances the user experience in Salesforce by providing contextual recommendations based on the current record. Results attached in the Insight Panel appear in the `AttachedResults` Lightning component on the record page, allowing service agents to quickly access relevant Knowledge articles, similar cases, or internal resources. ### Prerequisites * [Create a custom Insight Panel](https://docs.coveo.com/en/quantic/latest/usage/custom-insight-panels) with Coveo for Salesforce v4 or later. * Familiarity with [Attach to case result action](https://docs.coveo.com/en/3102#attach-to-case-result-action). * Access to the [Lightning App Builder in Salesforce](https://help.salesforce.com/s/articleView?id=platform.lightning_app_builder_overview.htm&type=5). * Familiarity with [record pages](https://help.salesforce.com/s/articleView?id=platform.lightning_app_builder_customize_lex_pages.htm&type=5). ### Implement the Attach to case result action To enable service agents to attach search results to Salesforce cases, add the Attach to case result action to your custom Insight Panel. See [Create a `ResultAttachToCase` LWC](https://docs.coveo.com/en/quantic/latest/usage/custom-ip-result-actions#create-a-resultattachtocase-lwc) to implement this feature. ### Add the Coveo Attached Results component to the record page Add the `CoveoV2_AttachedResults` component to the Case record page using the Lightning App Builder. This component automatically lists all results attached from the Insight Panel, making it easy for service agents to access relevant documents directly from the record. See [Add the Attached Results Lightning component to a record page](https://docs.coveo.com/en/3102#add-the-attached-results-lightning-component-to-a-record-page) for step-by-step instructions. Once you complete these steps, any result attached from the Insight Panel will appear in the `AttachedResults` component automatically. > **Note** > > After attaching a result, refresh the page to see the attached result in the component. ## User Actions The [`QuanticUserActionsToggle`](https://docs.coveo.com/en/quantic/latest/reference/insight-panel-components/insight-panel-user-actions-toggle/) component allows service agents to view recent user actions related to a case, providing valuable context for support interactions. This section describes how to integrate [User Actions](https://docs.coveo.com/en/m7ed8015#user-actions) into your custom Insight Panel. ### Prerequisite [Create a custom Insight Panel](https://docs.coveo.com/en/quantic/latest/usage/custom-insight-panels) with Coveo for Salesforce v4 or later. ### HTML Add the `QuanticUserActionsToggle` component to the HTML file of your custom Insight Panel. The following sample is abbreviated for clarity. See [exampleInsightPanel.html](https://github.com/coveo/ui-kit/blob/master/packages/quantic/force-app/solutionExamples/main/lwc/exampleInsightPanel/exampleInsightPanel.js) in the Quantic project repository for the full example. ```html ``` <1> The `record-id` attribute is set to be the case ID and is used to retrieve the user ID of its creator. This is required for enabling the User Actions feature. <2> The `userActionsReady` flag ensures that the component only renders when the necessary data is available. <3> The [`QuanticUserActionsToggle`](https://docs.coveo.com/en/quantic/latest/reference/insight-panel-components/insight-panel-user-actions-toggle/) component is used to display a button that opens a modal window containing the User Actions timeline component. ### JavaScript Update the JavaScript file for your custom Insight Panel to define the variables referenced in the preceding [HTML snippet](#html), and retrieve their values from the case record. The following sample is abbreviated for clarity. See [exampleInsightPanel.js](https://github.com/coveo/ui-kit/blob/master/packages/quantic/force-app/solutionExamples/main/lwc/exampleInsightPanel/exampleInsightPanel.js) in the Quantic project repository for the full example. ```js // ... defaultExcludedCustomActions = [ <1> 'ticket_field_update', 'ticket_next_stage', 'ticket_classification_click', 'generatedAnswerStreamEnd', ]; ticketCreationDateTime; ticketCreationUserId; userActionsReady = false; <2> //... /** * Executes the first search. * @returns {void} */ executeFirstSearch = () => { this.ticketCreationDateTime = this.getFieldValueFromRecord( <3> this.caseRecord, 'Case.CreatedDate' ); this.ticketCreationUserId = this.getFieldValueFromRecord( <4> this.caseRecord, 'Case.CreatedBy.Email' ); this.userActionsReady = true; // ... }; // ... ``` <1> Excludes custom actions from tracking. Adjust as needed for your organization's requirements. <2> Renders the component when the `userActionsReady` value changes to `true` after the required data is loaded. <3> Extracts the time the case was created from the `Case.CreatedDate` field of the case record. <4> Extracts the email of the user who created the case from the `Case.CreatedBy.Email` field. With this setup, the User Actions feature can now be leveraged in your custom Insight Panel. ## Generated answers The [`QuanticGeneratedAnswer`](https://docs.coveo.com/en/quantic/latest/reference/search-components/search-generated-answer/) component displays AI-generated answers in your custom Insight Panel, using [Coveo Relevance Generative Answering (RGA)](https://docs.coveo.com/en/n9de0370/). It generates answers automatically when a non-empty query is submitted. You can additionally create a button that lets service agents trigger answer generation without typing a query. ### Prerequisites * [Create a custom Insight Panel](https://docs.coveo.com/en/quantic/latest/usage/custom-insight-panels) with Coveo for Salesforce v4 or later. * Prepare a [Relevance Generative Answering (RGA) implementation](https://docs.coveo.com/en/nb6a0390/) in your Coveo organization. You will especially need an [`answerConfigurationId`](https://docs.coveo.com/en/p5db9314#custom-search-interface). ### Add the Generated Answer component Add the `QuanticGeneratedAnswer` component to your custom Insight Panel. For a complete implementation example, see [exampleInsightPanel](https://github.com/coveo/ui-kit/blob/main/packages/quantic/force-app/solutionExamples/main/lwc/exampleInsightPanel/) in the Quantic project repository. ### Add an on-demand Generate Answer button To let service agents trigger answer generation without entering a search query, you can create a custom button that calls the `generateAnswer` action. This is useful when the Insight Panel displays contextual results based on the current case, and agents want to generate an AI answer from those results. For an implementation of this button, see the [generateAnswerButton](https://github.com/coveo/ui-kit/tree/main/packages/quantic/force-app/solutionExamples/main/lwc/generateAnswerButton) LWC in the Quantic project repository.