ケースビューコンポーネントを処理するサンプルコード
イベントがトリガーされたときのアクションを定義するためのサンプルコードが用意されています。コンポーネントを Web ページに埋め込む前に、ユースケースのサンプルコードを更新します。
サンプルコード
{
'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>