• NJ_Ray
  • NEWBIE
  • 5 Points
  • Member since 2014
  • Salesforce Engineer

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
All this while I have seen and played around with the chat button to open up the pre-chat form and then send the chat request out to the agent but my needs are the opposite now- My clients need a way in which the help form(which acts like the pre-chat form) should display the live chat button if an agent is available to chat. I have created a sample pre-chat form in html, also embeded the chat button code on the same page which displays if the agents are online, but how do I make the javascript logic work so that when the form is submitted(upon clicking on Chat Now) the chat button should carry forward the information to the Liveagent.
  • February 13, 2017
  • Like
  • 0
Hello experts, all this while I have seen and played around with the chat button to open up the pre-chat form and then send the chat request out to the agent but my needs are the opposite now- My clients need a way in which the help form(which acts like the pre-chat form) should display the live chat button if an agent is available to chat. I have created a sample pre-chat form in html, also embeded the chat button code on the same page which displays if the agents are online, but how do I make the javascript logic work so that when the form is submitted(upon clicking on Chat Now) the chat button should carry forward the information to the Liveagent.
 
  • January 26, 2017
  • Like
  • 0
I am a newbie just started to dig into the world of Apex and Visualforce page. Here is my scenario, please help me design this into code or just tell me the components involved ans some code snippets as examples.
I have a case feed page layout to which I would like to add a custom console component of a visualforce page
This visual force page should essentially contain "Cases" related list based upon the contact ID(parent) of the case(child object). In simple terms I would like to view all the other cases(Basically want to mimic the cases related list that you would see under a contact detail page) that this contact has besides the current case which is visible in the case feed. I believe the Visual force page to get the related list of cases from a case page(which returns the case Id ) is not enough, I would have to look up to the parent record of the case, i,e Case.Contact Id, Getid() and pass it to on to the child object to fecth the parent's-child related list il.e Contact's-Related cases. Is this even possible? If so, please guide me on its design. Thanks so much!
NJ
  • November 05, 2014
  • Like
  • 0
Hello experts,
I am a newbie just started to dig into the world of Apex and Visualforce page. Here is my scenario, please help me design this into code or just tell me the components involved ans some code snippets as examples.
I have a case feed page layout to which I would like to add a custom console component of a visualforce page
This visual force page should essentially contain "Cases" related list based upon the contact ID(parent) of the case(child object). In simple terms I would like to view all the other cases(Basically want to mimic the cases related list that you would see under a contact detail page) that this contact has besides the current case which is visible in the case feed. I believe the Visual force page to get the related list of cases from a case page(which returns the case Id ) is not enough, I would have to look up to the parent record of the case, i,e Case.Contact Id, Getid() and pass it to on to the child object to fecth the parent's-child related list il.e Contact's-Related cases. Is this even possible? If so, please guide me on its design. Thanks so much!
NJ
  • November 04, 2014
  • Like
  • 0
I've gone through the development documentation for Live Agent and need help with the following:

Background:
We are currently using the Customer Community and have the Live Agent chat request button located inside the community.

1) Display visitor name in Chat Monitor for Engaged and Chat Requests before agent accepts the chat.  Our agents want to see the person's name before they accept the chat.  My current approach includes a custom controller for the visualforce page that gets the current users info.

2) Use custom picklist fields from Case object (including those with dependent picklists) on Pre Chat Form and include that data to create a new case.

3)  Allow chat visitor to search for existing case number on Pre Chat Form and link to existing case if found.

It's messy, but here's what I have so far.
<apex:page id="CommunityPreChatForm" docType="html-5.0" standardcontroller="Case" extensions="CommunityPreChatController" showHeader="false">
	<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>

	<img src="{!$Resource.Live_Agent_Logo}"/><p/>
	<apex:outputText style="font-weight:bold;font-size:14px;color:#595959;padding:0 10px;" value="Chat with Technical Support"/><p/>
	<div id="chatFormDiv">
	<!-- Get chat visitor info and set for Live Agent -->
	<form method='post' id='prechatForm'>
		<apex:form>
			<div style="width:600px; height:auto; float:left; text-align:left;">
				<apex:outputText style="font-weight:bold;font-size:12px;color:#595959;float:left;padding:0 10px;" value="Product:"/>
				<apex:inputField value="{!Case.Affected_Product__c}" styleClass="picklist" required="true"></apex:inputField>
			</div><br/>
			<div style="width:600px; height:auto; float:left; text-align:left;">
				<apex:outputText style="font-weight:bold;font-size:12px;color:#595959;float:left;padding:0 10px;" value="Version:"/>
		 		<apex:inputField value="{!Case.Version__c}" styleClass="picklist" required="true"></apex:inputField>
			</div><br/>
			<div style="width:600px; height:auto; float:left; text-align:left;">
				<apex:outputText style="font-weight:bold;font-size:12px;color:#595959;float:left;padding:0 10px;" value="Category:"/>
		 		<apex:inputField value="{!Case.Request_Type__c}" styleClass="picklist" required="true"></apex:inputField>
			</div><br/>
			<div style="width:600px; height:auto; float:left; text-align:left;">
				<apex:outputText style="font-weight:bold;font-size:12px;color:#595959;float:left;padding:0 10px;" value="Topic:"/>
		 		<apex:inputField value="{!Case.Problem_Type__c}" styleClass="picklist" required="true"></apex:inputField><p/>
			</div><br/>
		 	<apex:outputText style="font-weight:bold;font-size:12px;color:#595959;float:left;padding:0 10px;" value="Provide a brief describe of the issue:"/>
		 	<apex:inputField value="{!Case.Subject}" styleClass="textarea" html-placeholder="How we can help?" required="true"></apex:inputField>

			<!-- Hidden Collection Fields -->
			<input type="hidden" name="liveagent.prechat:ContactFirstName" id="firstName" value="{!contactFirstName}"/>
			<input type="hidden" name="liveagent.prechat:ContactLastName" id="lastName" value="{!contactLastName}"/>
			<input type="hidden" name="liveagent.prechat:ContactEmail" id="email" value="{!contactEmail}"/>
			<input type="hidden" name="liveagent.prechat:CaseSubject" id="subject" value="{!caseSubject}}"/>
			<input type="hidden" name="liveagent.prechat:CaseDescription" id="description" value="{!Case.Description}"/>
			<input type="hidden" name="liveagent.prechat:CaseStatus" value="New"/>
			<input type="hidden" name="liveagent.prechat:CaseOrigin" value="Live Chat"/>
			<input type="hidden" name="liveagent.prechat:CaseRecordType" value="012F0000000zp0x"/>
			<input type="hidden" name="liveagent.prechat.name" id="prechat_field_name"/>

			<!-- Map Contact Fields via Form -->
			<input type="hidden" name="liveagent.prechat.findorcreate.map:Contact" value="FirstName,ContactFirstName;LastName,ContactLastName;Email,ContactEmail"/>

			<!-- Map Case Fields via Form -->
			<input type="hidden" name="liveagent.prechat.findorcreate.map:Case" value="Subject,CaseSubject;Status,CaseStatus;Origin,CaseOrigin;Description,CaseSubject;Request_Type__c,CaseRequestType"/>

			<!-- Find Contact and Match or Create  -->
			<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Contact" value="Email,true"/>
			<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Contact" value="Email,true"/>
			<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Contact" value="FirstName,true;LastName,true;Email,true;Phone,true"/>

			<!-- Create Case and attach Chat Details -->
			<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Case" value="Subject,true;Status,true;Origin,true"/>

			<!-- Link Contact to New Case -->
			<input type="hidden" name="liveagent.prechat.findorcreate.linkToEntity:Contact" value="Case,ContactId"/>

			<!-- Display Contact and Case as sub-tabs in Live Agent Console -->
			<input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Contact" value="true"/>
			<input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Case" value="true"/>

			<!-- Link Chat Transcript to Contact and Case -->
			<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Contact" value="ContactId"/>
			<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Case" value="CaseId"/>

			<!-- Hide Case Record Type from Agent -->
			<input type="hidden" name="liveagent.prechat.findorcreate.displayToAgent:CaseRecordType" value="false"/>

			<!-- Start Chat Button -->
			<p/><input type='submit' value='REQUEST A CHAT' id='prechat_sbumit' onclick="setName()"/>
	 	</apex:form>
		
		<!-- Set Chat Visitor name in Live Agent Console -->
		<script type="text/javascript">
			function setName(){
				document.getElementById("prechat_field_name").value = 
				document.getElementById("firstName").value + " " + document.getElementById("lastName").value;
			}
		</script>

		<!-- CSS -->
		<style>
			.picklist{
				width:300px;
				height:20px;
				background: #fff;
				border: 1px solid #CCCCCC;
				border-radius: 5px;
				margin-bottom: 5px;
				padding: 0 10px;
			}
			select{
				width:300px;
				height:20px;
				background: #fff;
				border: 1px solid #CCCCCC;
				border-radius: 5px;
				margin-bottom: 5px;
				padding: 0 10px;
			}
			.textarea{
				width:450px;
				height: 100px;
				background: #fff;
				border: 1px solid #CCCCCC;
				border-radius: 5px;
				margin-bottom: 5px;
				padding: 0 10px;
			}
		</style>
		
		<style>
		body{
		background-color:#fff;
		}
		#chatFormDiv
		{
		width:300px;
		text-align:center;
		padding:5px;
		}
		#chatHeader
		{
		color:#6d6d6d;
		font-size:18px;
		font-weight:bold;
		float: center;
		}
		#prechat_submit
		{
		font-weight:bold;
		float: center;
		}
		label
		{
		width:150px;
		font-weight:bold;
		}
		input[type=text], textarea
		{
		height: 50px;
		width:400px;
		background: #fff;
		border: 1px solid #CCCCCC;
		border-radius: 5px;
		margin-bottom: 5px;
		padding: 0 10px;
		}
		input[type=email]
		{
		height: 30px;
		width:280px;
		background: #fff;
		border: 1px solid #CCCCCC;
		border-radius: 3px;
		margin-bottom: 5px;
		padding: 0 10px;
		}
		input[type=tel]
		{
		height: 30px;
		width:280px;
		background: #fff;
		border: 1px solid #CCCCCC;
		border-radius: 3px;
		margin-bottom: 5px;
		padding: 0 10px;
		}
		input[type=text]
		{
		height: 30px;
		}
		textarea{
		height:140px;
		padding-top: 10px;
		padding-bottom: 10px;
		}
		.chatStatusDiv
		{
		display:none;
		}
		</style>
	</form>
	</div>
</apex:page>

 
I created several process builder proceeses around check boxes on the contact object.  I wanted to trigger these to update in mass so I created a hidden checkbox field on the contact object called 'Mass Update', set the value to true for all and trying to do an update. I got the error: The record couldnt be saved because it failed to trigger a flow. <br>A flow trigger failed to execute the flow with version ID 30116000000PPKL. <br/> Contact your administrator for help.

I don't have any active conflicting workflow rules on these fields.  When I tested the active processes they all individually worked. Why am I getting this for all 16K contacts i'm trying to update using Jitterbit? 
I am a newbie just started to dig into the world of Apex and Visualforce page. Here is my scenario, please help me design this into code or just tell me the components involved ans some code snippets as examples.
I have a case feed page layout to which I would like to add a custom console component of a visualforce page
This visual force page should essentially contain "Cases" related list based upon the contact ID(parent) of the case(child object). In simple terms I would like to view all the other cases(Basically want to mimic the cases related list that you would see under a contact detail page) that this contact has besides the current case which is visible in the case feed. I believe the Visual force page to get the related list of cases from a case page(which returns the case Id ) is not enough, I would have to look up to the parent record of the case, i,e Case.Contact Id, Getid() and pass it to on to the child object to fecth the parent's-child related list il.e Contact's-Related cases. Is this even possible? If so, please guide me on its design. Thanks so much!
NJ
  • November 05, 2014
  • Like
  • 0