• Thomas R.ax1441
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi there,

 

Anyone has the API for live agent, i need to customize the deployment and pre-chat form. Though SF has dev guide,it is too rough.
 Please help.

 

Regards,

Thomas

I'm attempting to lookup existing case numbers for live agents if a customer provides a case number. I'm doing this in my code, but it doesn't appear to work. Is there something else I have to do? I've placed the code below and bolded the line where I believe this should be working?

 

<apex:page showHeader="false">
<!-- This script takes the endpoint URL parameter passed from the deployment page and makes
it the action for the form -->
<script type="text/javascript">
(function() { function handlePageLoad() {
var endpointMatcher = new RegExp("[\\?\\&]endpoint=([^&#]*)");
document.getElementById('prechatForm').setAttribute('action',
decodeURIComponent(endpointMatcher.exec(document.location.search)[1]));
} if (window.addEventListener) {
window.addEventListener('load', handlePageLoad, false);
} else { window.attachEvent('onload', handlePageLoad, false);
}})();
</script>

<h1>Pre-chat Form</h1>
<form method='post' id='prechatForm'>
    Last Name: <input type='text' name='liveagent.prechat.name' id='prechat_field' /><br />
    Email Address: <input type='text' name='liveagent.prechat:Email' /><br />
    Previous Case Number (if applicable): <input type='text' name='liveagent.prechat:CaseNumber' /><br />
    Product: <select name="liveagent.prechat.buttons">
        <option value="573C0000000Gmli">TestProduct</option>
    </select><br />

<!-- Creates an auto-query for a matching Contact record’s Email field based on the value of the liveagent.prechat:Email field -->
<input type="hidden" name="liveagent.prechat.query:Email" value="Contact,Contact.Email"/>
<input type="hidden" name="liveagent.prechat.query:CaseNumber" value="Case,Case.CaseNumber"/>
<input type="hidden" name="liveagent.prechat.save:Email" value="Email__c" />
<input type='submit' value='Request Chat' id='prechat_submit'/>
<style type="text/css"> p {font-weight: bolder } </style>
</form>
</apex:page>