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
RamzilCleoRamzilCleo 

Live agent Search Filter

I have created a Pre chat page for Live agent

 

<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 method='post' id='prechatForm'>
Name: <input type='text' name='liveagent.prechat.name' id='prechat_field' /><br />
Email Address: <input type='text' name='liveagent.prechat:Email' /><br />
Account ID: <input type='text' name='liveagent.prechat:Account_NASP_ID__c' /><br />
Department: <select name="liveagent.prechat.buttons">
<!-- Values are LiveChatButton IDs. -->
<option value="0C5Z00000004CDu">Billing Service</option>
<option value="0C5Z00000004CDz">Technical Support</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.save:Email" value="Email__c" />

<!-- Creates an auto-query for a matching Account record’s NASP ID field based on the
value of the liveagent.prechat:Account ID field -->
<input type="hidden" name="liveagent.prechat.query:Account_NASP_ID__c"
value="Account,Account.Account_NASP_ID__c" />
<input type="hidden" name="liveagent.prechat.save:Account_NASP_ID__c" value="Account_NASP_ID__c" />

<input type='submit' value='Request Chat' id='prechat_submit'/>
<style type="text/css">
p {font-weight: bolder }
</style>
</form>
</apex:page>

 

When the user fills the pre chat form contacts are displayed based on the email entered.

I want accounts to be displayed based on the Account_NASP_ID__c (custom lookup field on account)

 

Can someone help me on this?