---
sourceDocument: Australia Customer Service Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/customer-service-management

 Release :

    - australia

ft:locale :

    - pt-BR

ft:publication_title :

    - Australia Customer Service Management

ft:clusterId :

    - csm

bundleId :

    - csm

workflow :

    - Customer and Industry


---

# Sample code for the Case list component

# Sample code for the Case list component {#ariaid-title1}

* Versão de lançamento: Australia
* 
* Atualizado 12 de mar. de 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 min. de leitura

Sample code is provided to define an action when an event is triggered. Update the sample code for your use case before embedding the component on your webpage.

## Sample code {#we-case-list-sample-code__section_g2x_1yn_c2c}

    { 

    'SN_EMBEDX_CASE_LIST#RECORD_SELECTED' : (e) => { 

    // This event is dispatched when a record is selected. 

    var {table, record_sys_id} = e.detail.payload; 

    // the logic to construct the URL for the Case View component. Add your portal URL here. 

    const caseViewURL = '/caseview?emb_table='+table+'&emb_recordid='+record_sys_id; 

    // Redirect to the Case view component page 

    open(caseViewURL,'_self'); 

    }, 

    'SN_EMBEDX_CASE_LIST#COMPONENT_READY' : (e) => { 

    // This event is dispatched when a component is ready and usable. 

    }, 

    'SN_EMBEDX_CASE_LIST#COMPONENT_ERROR' : (e) => { 

    // This event is dispatched when a property validation or internal error occurs. 

    var {errorMessage, errorType} = e.detail.payload; 

    console.log(errorMessage, errorType); 

    } 

**Tarefas relacionadas**   

* [Configure the Case list component instance](https://servicenow-prod.fluidtopics.net/uac6Mso8kRnW~bsoFfaXFA "Configure the Case list component instance so that your user can embed it on their website to access the list of all cases from their website directly.")
* [Embed the Case list component instance on the third-party website](https://servicenow-prod.fluidtopics.net/tdyUh0JeCn51CZdxCfvTwQ "Embed the global code and component code of the Case list component instance that you configured so that you can enable your customers to start using the Case list component instance on your third-party website.")  
**Referência relacionada**   

* [Component properties for the Case list](https://servicenow-prod.fluidtopics.net/ZnGLxPTPdJIZha7rgEbA8Q "Component properties enable you to configure the behavior of the Case list component instance on a third-party website.")
* [Event handler in the Case list component](https://servicenow-prod.fluidtopics.net/Jwj8Y0fPcWonIio56N7ZdA "A component triggers an event when a certain condition is met or on user interaction. The event can be used to execute an action through a code on a third-party webpage.")

