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
James RadcliffeJames Radcliffe 

Update the Record Owner to the Agent who accepted the live chat request.

Hi,

We have implemented live chat in our organisation. The steps leading up to chat are:

1) A Customer creates a Case via a Customer Portal.
2) The Chat Button is THEN presented to the Customer (once a Case has already been created in Salesforce).
3) The Customer Requests the Chat the normal way by selecting the button.
4) The Agent Accepts the Chat Request and the initial Case opened as a Subtab.

Requirement: I am looking for a way to update that Case's Owner to the be the Agent who accepted the Case.

I built a trigger that ran on the LiveChatTranscriptEvents Object, but have since discovered that a transcript is not created until after a chat has ended. As a transcript event cannot exist without a transcript I presume these events also do not exist until after the chat has ended.

Is there any way we can access the event that occurs when the Agent selects the Accept button? 
Akanksha  PatelAkanksha Patel
Hi James,

Try using the findOrCreate method.
Use the findOrCreate method to find existing records or create new ones based on certain criteria.
Usage Finds or creates a record of the specified type when an agent accepts a chat request. Note: The findOrCreate method begins the API call that finds existing records or create new records when an agent begins a chat with a customer. You must use this method before calling any of the other findOrCreate sub-methods for finding or creating records with the Deployment API.
Please follow the link to get more information.
https://resources.docs.salesforce.com/sfdc/pdf/live_agent_dev_guide.pdf

Let us know if this was helpful.

Thanks
Akanksha