--- title: Customize the AttachToCase for the Coveo Insight Panel Classic Component (Deprecated) slug: '1257' canonical_url: https://docs.coveo.com/en/1257/ collection: coveo-for-salesforce source_format: adoc --- # Customize the AttachToCase for the Coveo Insight Panel Classic Component (Deprecated) [.version.no-link.classic] Salesforce Classic > **Deprecated** > > This feature is still available, but no longer supported as of the August 2023 release of Coveo for Salesforce version [5.2](https://docs.coveo.com/en/n5bj0150#august-2023-release-v5-2-initial-release). The [Attach to case result action](https://docs.coveo.com/en/3102#attach-to-case-result-action) lets you attach any type of results to a Salesforce Case. When a user clicks **Attach** or on its icon ![Attach icon | Coveo for Salesforce](coveo-for-salesforce/attachments/32933270/37103274.png), a record of type `AttachedResult` is created and linked to the current case. The `AttachedResult` object is installed with Coveo for Salesforce, and contains the `Case`, `URL`, `Title`, `Source`, and `UriHash` fields by default. You can use those fields in your case layout to have more information about the results attached to that case. However, you might want to add your own fields to the `AttachedResults` object, so that you can display them in your case layout. To do so, follow these steps. ## Adding fields to the `AttachedResults` object . In Salesforce, in **Setup**, search for and select **Objects** (**Build** > **Create** > **Objects**). . Under **Custom Objects**, select **Attached Result**. . In **Custom Fields & Relationships**, select **New**, and [create your custom field](https://help.salesforce.com/apex/HTViewHelpDoc?id=adding_fields.htm&language=en). > **Tip** > > Take note of its **API Name**, as you'll be needing it. . Access your Coveo Insight Panel Classic Component, and then select **Customize Panel**. . Access your page code by selecting the **Code View** tab at the top of the page, or by checking the **Advanced Mode** box and selecting the **Code** tab for earlier versions. . In your page, in a `script` tag, add the following code. Make sure to change `myCustomField__C` and `myCustomField2__C` with the **API Name** of your field. ```javascript $("#search").on(Coveo.UserActionEvents.attachToCase, function(e, arg) { arg.dataToAttach.customs["myCustomField__C"] = "myCustomValue"; // You can use static values arg.dataToAttach.customs["myCustomField2__C"] = arg.result.myValue; // Or use value from one of your result field }); ``` > **Note** > > The `arg` variable contains two objects: > > * `dataToAttach` contains the default data that will be added to the new `AttachedResult` object. > > * `result` contains additional data about the current result. . Click **Save**. . Ensure that your custom field is displayed in your console **Case Layout** (see [Edit Page Layouts for Standard Objects](https://help.salesforce.com/articleView?id=accessing_layout_standard.htm&type=0&language=en_US)).