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
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.