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>