Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Sample code to handle the Case view component

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

{ 

'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>

Related topics

Configure the Case view component instance

Embed the Case view component instance on the third-party website

Component properties for the Case view

Event handler in the enhanced Case view component