function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sowjanya Hegde 13Sowjanya Hegde 13 

Autoclose the omnichannel chat window

Autoclose the omnichannel chat window in chat transcript object when the chat is done, that is when the user on the other end close the chat window or when they say bye or Thank you. How to write the trigger for this automation. Please help!
Best Answer chosen by Sowjanya Hegde 13
VinayVinay (Salesforce Developers) 
Hi Sowjanya,

I don't think this can be done based on chat like bye and thank you.  However use 'lightning:conversationChatEnded' for closest possible way.

Below are references along with example.

https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_events_liveagent_conversationchatended.htm
https://www.infallibletechie.com/2020/07/how-to-close-chat-tab-when-conversation.html

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,

All Answers

VinayVinay (Salesforce Developers) 
Hi Sowjanya,

I don't think this can be done based on chat like bye and thank you.  However use 'lightning:conversationChatEnded' for closest possible way.

Below are references along with example.

https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_events_liveagent_conversationchatended.htm
https://www.infallibletechie.com/2020/07/how-to-close-chat-tab-when-conversation.html

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
This was selected as the best answer
Sowjanya Hegde 13Sowjanya Hegde 13

Thank you!

Does this close the record tab related to that chat which is just ended ?

VinayVinay (Salesforce Developers) 
It closes the chat tab when the conversation is ended and since it has recordId it should close work record that’s associated with the current chat.

Thanks,
Sowjanya Hegde 13Sowjanya Hegde 13

https://www.infallibletechie.com/2020/07/how-to-close-chat-tab-when-conversation.html worked for me.

Thank you Vinay!