0

I have gone through the Live Agent Developer Guide (http://www.salesforce.com/us/developer/docs/live_agent_dev/live_agent_dev_guide.pdf), and I think I have a good idea on how to put together a custom live agent solution. One thing I would like to do is, when the chat ends, take the body of the transcript and add it to a custom field in the Case record. The Case record must be the one that is created from the pre-chat form. I'm guessing I can do this in Apex, but how do I associate the data (live chat transcript, Case ID) with the Apex controller?

  • What if the case has multiple transcripts as it can often happen?. Do you have a reason not to use the standard "related transcript" functionality? – PepeFloyd Nov 25 '14 at 9:55
  • How exactly does the standard 'related transcript' functionality work? Are you saying that SFDC automatically associates a Case with a transcript? – hamayoun Nov 25 '14 at 21:36
  • Yes, you don't need any Apex code to relate the transcript to the case. – PepeFloyd Nov 25 '14 at 21:37
2

You can automatically attach the transcript to a record i.e. a case by using the saveToTranscript method. Depending on wheter you are using the pre-chat API or deployment API all you have to do is follow the instructions on the developer guide to automatically related the transcript to the case.

findOrCreate.saveToTranscript

Syntax

 <input type="hidden" name= "liveagent.prechat.findorcreate.saveToTranscript: String
    entityName" value= "String transcriptFieldName" />
  • Pepe, thanks for your input, but (and I haven't tried this yet) from my understanding of what the dev guide says, this will attach the Case to the LiveChatTranscript object. What I need to do is the other way round: save the transcript in the Case object. After thinking about this for a while, I believe this can be done by writing an 'after insert' trigger on the LiveChatTranscript object. But I was wondering if it could be done using the pre-chat or deployment API. – hamayoun Nov 25 '14 at 22:51
  • Yes, this will populate the Case field in the transcript record so that you will be able to see the transcripts from the case by simply scrolling down to the related list. This is the recommended way of implementing this. Bear in mind the transcript contains more information than just the conversation, so it is a better to keep it in a separate object. – PepeFloyd Nov 25 '14 at 22:59
  • Ok Pepe, although what you say is not documented explicitly, there is a blog by Peter Knolle (peterknolle.com/live-agent-pre-chat-api) where he answers a similar question in the comments. Thank You! – hamayoun Nov 26 '14 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.