---
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 to handle the Case view component

# Sample code to handle the Case view 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-view-sample-code__section_n1x_cyn_c2c}

    { 

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

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

    }, 

    'SN_EMBEDX_CASE_VIEW#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); 

    }, 

    'SN_EMBEDX_CASE_VIEW#CASE_COMMENT_ADDED' : (e) => { 

    // This event is dispatched when a comment is added in the activity stream. }
    	};

    	setEvents(snEmbedxCaseView, eventHandlers);
    </script>

**Tarefas relacionadas**   

* [Configure the Case view component instance](https://servicenow-prod.fluidtopics.net/CV2O5LTNEDzxDUoYKOaEmg "Configure the Case view component instance so that your user can embed it on their website to access the case-related activities on their website directly.")
* [Embed the Case view component instance on the third-party website](https://servicenow-prod.fluidtopics.net/jhTRztFoKjRZMuSjfuIGHA "Embed the global code and component code of the Case view component instance that you configured so that you can enable your customers to start using the Case view component instance on your third-party website.")  
**Referência relacionada**   

* [Component properties for the Case view](https://servicenow-prod.fluidtopics.net/H_8bHv7aZZRABBl4PcdAUA "Component properties enable you to configure the behavior of the Case view component instance on a third-party website.")
* [Event handler in the enhanced Case view component](https://servicenow-prod.fluidtopics.net/b1yHPZFVFg7Whfh2kOKZmQ "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 third-party webpage.")

