+ Start a Discussion
Wolfgang FernandesWolfgang Fernandes 

Create Case Live Agent

Hello guys, I'm having trouble creating a case via live agent. Follows the code I am using. If anyone can help, thank you.
<input type="hidden" name="liveagent.prechat:caseOrigin" value="Chat" /> 
<input type="hidden" name="liveagent.prechat.findorcreate.map:Case" value="Origin,caseOrigin;" /> 
<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Case" value="Origin,true" /> 
<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Case" value="Case" /> 
<input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Case" value="true" /> 
<!-- Link the Contact to the Case -->
<input type= "hidden" name="liveagent.prechat.findorcreate.linkToEntity:Account" value="Case,AccountId" />
Andreas MeyerAndreas Meyer
Hi Wolfgang,
do you really need to use the prechat API for that? Otherwise go with deplyment.js:
 
<script type='text/javascript'>
  // create case
  liveagent.addCustomDetail("Case Subject", "new chat case");
  liveagent.addCustomDetail("Case Status", "New", false);
  liveagent.addCustomDetail("Case Origin", "Chat", false);  
  
  liveagent.findOrCreate("Case").map("Subject", "Case Subject", false,false,true).map("Status", "Case Status", false, false, true).map("Origin", "Case Origin", false, false, true).showOnCreate().saveToTranscript("Case").linkToEntity("Account", "AccountId");

</script>

Best,
Andreas
 
Wolfgang FernandesWolfgang Fernandes
Hello, I tried to use that way I also did not create the event. I can not say why, the code is the same for creation of the case. Thank you, if you know another way you can help.