Pre-Chat Form

First name:
Last name:
Unit Model:
Serial Number:
and here is my button config which is i'm already add my VFP pages on it and one thing, when i looked into browser console i get this message info, is it related? thanks in advance.", "answerCount": 1, "upvoteCount": 0, "datePublished": "2021-05-05T07:32:58.000Z", "author": { "@type": "Person", "name": "irfan fathoni", "url": "https://trailblazers.salesforce.com/profileView?u=0053A00000EWSfnQAH", "affiliation": { "@type": "Organization", "name": "--" } }, "suggestedAnswer": [ { "@type": "Answer", "text": "Hi Irfan,   Sorry for the inconvenience. In case you don't receive a response here, may I also suggest joining the group below to collaborate with the experts for best practice and advice.   https://developer.salesforce.com/forums#!/feedtype=RECENT&criteria=ALLQUESTIONS &   Hope this helps.   Regards,   #.redirect", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8hDMSAZ", "datePublished": "2021-05-06T09:31:46.000Z", "author": { "@type": "Person", "name": "Kermit Del Rosario", "url": "https://trailblazers.salesforce.com/profileView?u=0054S0000017dEMQAY", "affiliation": { "@type": "Organization", "name": "--" } } } ] } }
Skip to main content
Hello Community,

 

currently i'm still develop a custom pre-chat for my org, and i have a problem in here.

 

here is my custom pre-chat i've created

 

Custom pre-chat API won't connect to agent

 

whenever i tried to submit "click to chat" button, it doesn't connect to an agent even though the agent is already on 'online' status. am i missing something in here?

 

For reference here is my pre-chat code ;

 

<apex:page >

 

    <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 that gathers information from the chat visitor and sets the values to Chat Custom Details used later in the example -->

 

<form method='post' id='prechatForm'>

 

    First name: <input type='text' name='liveagent.prechat:LiveChatTranscriptFirst_Name__c' id='firstName' /><br />

 

    Last name: <input type='text' name='liveagent.prechat:LiveChatTranscriptLastName' id='lastName' /><br />

 

    Unit Model: <input type='text' name='liveagent.prechat:LiveChatTranscriptUnit_Model__c' id='unit_model' /><br />

 

    Serial Number: <input type='text' name='liveagent.prechat:LiveChatTranscriptSerial_Number__c' id='serial_number' /><br />

 

    

 

    <input type="hidden" name="liveagent.prechat.name" id="prechat_field_name" />

 

    <input type='submit' value='Click to Chat' id='prechat_submit' /> 

 

    

 

    <input type= "hidden" name="liveagent.prechat.findorcreate.linkToEntity:Account" value="Case,AccountId" />

 

<style type="text/css">

 

p {font-weight: bolder }

 

</style>

 

    

 

</form>

 

</apex:page>

 

and here is my button config which is i'm already add my VFP pages on it

 

User-added image

 

and one thing, when i looked into browser console i get this message info, is it related?

 

User-added image

 

thanks in advance.
1 answer
0/9000