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
Jake Liew Wei JieJake Liew Wei Jie 

LiveChatTranscript Trigger Before Insert not display in log

Hi everyone,
This was my first time asking question in salesforce developer forum.

My org was using omni-channel to receive live chat message for visitor. Therefore i want to implement some custom action before chat transcript was created.

I've added a trigger on this object and using before insert, but when i tried to system.debug() i notice in developer console won't display any log was created for before insert.

Therefore, i also tested on other object like "Case" it was able to display debuging info.

I've also tried to untick developer console -> Debug -> Show My Current Logs Only, to preview all log. Unfortunately, i couldn't find any related log. But when i test with same object but before update it was working and able to log debug info.

Here was my personal assumption, is it because this insertation was done by system it self, therefore i couldn't find log in developer console?

Appriciate if anyone could answer this.

Thanks in advance.

 

User-added imageUser-added imageUser-added image

AnudeepAnudeep (Salesforce Developers) 
Hi Jake - Are you able to see the debug log once the LiveChatTranscript record is created? My understanding after reviewing this documentation is when a chat ends successfully—that is, when the chat is ended by a customer or an agent—the chat transcript is created as soon as the agent closes the chat window and it is same as how a LiveChatTranscriptEvent

See Considerations for LiveChatTranscriptEvent records creation during the chat where a before insert sample code is provided

 
Jake Liew Wei JieJake Liew Wei Jie

Hi Anudeep,
Thanks for providing these info.

Currently I'm using Omni Channel to connect live chat. Therefore following the documentation it wrote "When you’re using Omni-Channel routing, the chat transcript is created when the chat’s requested by a visitor." .
Therefore i assume it will always create a record whenever was requested.

AnudeepAnudeep (Salesforce Developers) 
Hi Jake - If that is the case,  I recommend doing a query on LiveChatTranscript data to confirm if the record is created during the time of the request
Select id, body from LiveChatTranscript
If the record is created, the debug logs should be generated as far as I know 

Regards, 
Anudeep



 
Jake Liew Wei JieJake Liew Wei Jie
Hi Anudeep, 
I've tested adding custom data into new field of "Trigger.new" and adding few System debug line to observe was it pass thru.
As result the custom data successful stored into object, but in developer console the system debug doesn't appear.

Thanks
Mario Gomez SanchezMario Gomez Sanchez

Hi Jake,
If you're still looking for this...  Your LiveChatTranscript is created by the Automated Process user. In order to track the interactions you must create a trace flag with entity type as Automated Process.

Create a new Trace Flag:

In Setup,

  1. Logs > Debug Logs
  2. Click "New" (trace flag)
  3. select "Automated Process" as the Traced Entity Type
  4. Complete the trace flag creation
  5. Save
Ajitesh Singh 19Ajitesh Singh 19
Hi Jake Liew Wei Jie,

Greetings!

I hope you may have resolved the issue by now incase you didn't, I was also going through the same issue. The catch here is the triggers fires as soon as the chat Window is closed at the Agent's end.

If you are logged in using Admin user to test the fucntionality just create debug log for current user or view the same in log section of developer console.

Thank you