You need to sign in to do that
Don't have an account?
Mugdha Kshirsagar
How to create case automatically with the chat contents in live agent using apex triggers?
Hi,
I am new to apex and coding as well. I want to know how to create case record when user is done with the chat through live agent and clicks on end chat button.
I am new to apex and coding as well. I want to know how to create case record when user is done with the chat through live agent and clicks on end chat button.
All Answers
I have implemented live agent internally in my developer edition.
Can you put your code, i would like to see how it works. I have a similar requirement.
trigger SetDescOnCase on LiveChatTranscript (after insert) { LiveChatTranscript[] scripts = Trigger.new; if(scripts == null) return; if(scripts.size() <= 0) return; LiveChatTranscript script = scripts[0]; System.debug(script); String body = script.Body; String caseid = script.CaseId; String email = ''; try { Case c = Database.query('SELECT Description FROM Case WHERE Id = :caseid limit 1'); c.Description = script.Body.stripHtmlTags(); update c; } catch (Exception e){ System.debug(e.getMessage()); } }