• Matías Serrano Vera
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hello,

Can anyone please give me idea how to dynamically get value from addCustomDetail in LiveAgent.

This code is not working..
liveagent.addCustomDetail("First_Name",document.getElementById("FirstName").value);

and here's the whole Code.
 
<script type='text/javascript' src='https://c.la1-c1cs-ukb.salesforceliveagent.com/content/g/js/41.0/deployment.js'></script>

<script type='text/javascript'>
 
//Custom Details
  liveagent.addCustomDetail("Customer_Name",document.getElementById("prechat_field_name").value);
  //CASE
  liveagent.addCustomDetail("Case_Status", "New");
  liveagent.addCustomDetail("Case_Origin", "Chat");
  liveagent.addCustomDetail("Case_Record Type", "01228000000isic");
  liveagent.addCustomDetail("Case_Product", "House and Land");
  liveagent.findOrCreate("Case")
    .map("Subject","Case_Origin",false,false,true)
    .map("Status","Case_Status",false,false,true)
  	.map("Product__c","Case_Product",false,false,true)
  	.map("RecordTypeId","Case_Record",false,false,true)
    .saveToTranscript("CaseId")
    .showOnCreate();
  
  
//End of Custom Details
liveagent.init('https://d.la1-c1cs-ukb.salesforceliveagent.com/chat', '5725D000000000f', '00D5D0000000TZM');
</script>
I hope you can help me here.. Thank you!