• Laura McCraven at ACN
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
My code is below, no matter how many variations of this I try, nothing will create my Person Account. If I remove the reference to Record Type Id, it will create without a Record Type and if I change the Record Type Id to a business one, it will create but I can't get it to create the Person Account.  It will also find an existing Person Account correctly.

What am I missing or not mapping correctly? PLEASE HELP! 

        
        First Name: <input type='text' name='liveagent.prechat:AccountFirstName' id='firstName' /><br />
        Last Name: <input type='text' name='liveagent.prechat:AccountLastName' id='lastName' /><br />
        Email: <input type='text' name='liveagent.prechat:AccountEmail' id='email' /><br />
        Phone: <input type='text' name='liveagent.prechat:AccountPhone' id='phone' /><br />
        Issue: <input type='text' name='liveagent.prechat:CaseSubject' id='subject' /><br />
        
        <!-- Hidden fields used to set additional custom details -->
        <input type="hidden" name="liveagent.prechat:CaseOrigin" value="Chat" />
        <input type="hidden" name="liveagent.prechat:CaseStatus" value="New" />
        <input type="hidden" name="liveagent.prechat:CaseRecordType" value="01215000001JRES" />
        <input type="hidden" name="liveagent.prechat:AccountRecordType" value="01215000001JRKk" />
        <input type="hidden" name="liveagent.prechat.name" id="prechat_field_name" />
        
        <!-- map: Use the data from prechat form to map it to the Salesforce record's fields -->
        <input type="hidden" name="liveagent.prechat.findorcreate.map:Account" value="FirstName,AccountFirstName;LastName,AccountLastName;Phone,AccountPhone;PersonEmail,AccountEmail;RecordTypeId,AccountRecordType" />
        
        <input type="hidden" name="liveagent.prechat.findorcreate.map:Case" value="Subject,CaseSubject;Status,CaseStatus;Origin,CaseOrigin;RecordTypeId,CaseRecordType" />
        
        <!-- doFind, doCreate and isExactMatch example for an Account: 
        Find an Account whose Email exactly matches the value provided by the customer in the form 
        If there's no match, then create an Account record and set it's First Name, Last Name, Email, and Phone to the values provided by the customer -->
        <input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Account" value="PersonEmail,true" />
        <input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Account" value="PersonEmail,true" />
        <input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Account" value="FirstName,true;LastName,true;Phone,true;PersonEmail,true;RecordTypeId,true" /> 
        
        <!-- doCreate example for a Case: create a case to attach to the chat, set the Case Subject to the value provided by the customer and set the case's Status and Origin fields -->
        <input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Case" value="Subject,true;Status,true;Origin,true;RecordTypeId,true" />
        
        <!-- linkToEntity: Set the record Account record, found/created above, as the Account on the Case that's created --> 
        <input type="hidden" name="liveagent.prechat.findorcreate.linkToEntity:Account" value="Case,AccountId" />
        
        <!-- showOnCreate: Open the Account and Case records as sub-tabs to the chat for the agent in the Console -->
        <input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Account" value="true" />
        <input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Case" value="true" />
        
        <!-- saveToTranscript: Associates the records found / created, i.e. Contact and Case, to the Live Chat Transcript record. --> 
        <input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Account" value="AccountId" />
        <input type='submit' value='Chat Now' id='prechat_submit' onclick="setName()"/>
My code is below, no matter how many variations of this I try, nothing will create my Person Account. If I remove the reference to Record Type Id, it will create without a Record Type and if I change the Record Type Id to a business one, it will create but I can't get it to create the Person Account.  It will also find an existing Person Account correctly.

What am I missing or not mapping correctly? PLEASE HELP! 

        
        First Name: <input type='text' name='liveagent.prechat:AccountFirstName' id='firstName' /><br />
        Last Name: <input type='text' name='liveagent.prechat:AccountLastName' id='lastName' /><br />
        Email: <input type='text' name='liveagent.prechat:AccountEmail' id='email' /><br />
        Phone: <input type='text' name='liveagent.prechat:AccountPhone' id='phone' /><br />
        Issue: <input type='text' name='liveagent.prechat:CaseSubject' id='subject' /><br />
        
        <!-- Hidden fields used to set additional custom details -->
        <input type="hidden" name="liveagent.prechat:CaseOrigin" value="Chat" />
        <input type="hidden" name="liveagent.prechat:CaseStatus" value="New" />
        <input type="hidden" name="liveagent.prechat:CaseRecordType" value="01215000001JRES" />
        <input type="hidden" name="liveagent.prechat:AccountRecordType" value="01215000001JRKk" />
        <input type="hidden" name="liveagent.prechat.name" id="prechat_field_name" />
        
        <!-- map: Use the data from prechat form to map it to the Salesforce record's fields -->
        <input type="hidden" name="liveagent.prechat.findorcreate.map:Account" value="FirstName,AccountFirstName;LastName,AccountLastName;Phone,AccountPhone;PersonEmail,AccountEmail;RecordTypeId,AccountRecordType" />
        
        <input type="hidden" name="liveagent.prechat.findorcreate.map:Case" value="Subject,CaseSubject;Status,CaseStatus;Origin,CaseOrigin;RecordTypeId,CaseRecordType" />
        
        <!-- doFind, doCreate and isExactMatch example for an Account: 
        Find an Account whose Email exactly matches the value provided by the customer in the form 
        If there's no match, then create an Account record and set it's First Name, Last Name, Email, and Phone to the values provided by the customer -->
        <input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Account" value="PersonEmail,true" />
        <input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Account" value="PersonEmail,true" />
        <input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Account" value="FirstName,true;LastName,true;Phone,true;PersonEmail,true;RecordTypeId,true" /> 
        
        <!-- doCreate example for a Case: create a case to attach to the chat, set the Case Subject to the value provided by the customer and set the case's Status and Origin fields -->
        <input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Case" value="Subject,true;Status,true;Origin,true;RecordTypeId,true" />
        
        <!-- linkToEntity: Set the record Account record, found/created above, as the Account on the Case that's created --> 
        <input type="hidden" name="liveagent.prechat.findorcreate.linkToEntity:Account" value="Case,AccountId" />
        
        <!-- showOnCreate: Open the Account and Case records as sub-tabs to the chat for the agent in the Console -->
        <input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Account" value="true" />
        <input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Case" value="true" />
        
        <!-- saveToTranscript: Associates the records found / created, i.e. Contact and Case, to the Live Chat Transcript record. --> 
        <input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Account" value="AccountId" />
        <input type='submit' value='Chat Now' id='prechat_submit' onclick="setName()"/>

Hi all, I am so close to finishing this process automation badge but am stuck in one area in Step 7.

I've built out my process builder as follows

User-added image
User-added image
User-added image

And my date formula as follows
 

Case(MOD(Date__c-DATE(1900,1,7),7),0,"Sunday",1,"Monday",2,"Tuesday",3,"Wednesday",4,"Thursday",5, "Friday",6,"Saturday", "")
 



Challenge Not yet complete... here's what's wrong:  The Robot Setup Day of the Week formula does not seem to be working properly. The Day of the Week should not fall on Saturday or Sunday. 

It works nicely but doesn't seem to pass, what could be up.
 

I want to create person account from pre chat window customer details but getting created business account.

Please help me out my code is below for pre chat window form

<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>Live Agent Pre-Chat Form</h1>

<!-- Form that gathers information from the chat visitor and sets the values to Live Agent Custom Details used later in the example -->
<form method='post' id='prechatForm'>

    Name: <input type='text' name='liveagent.prechat:AccountName' id='firstName' /><br />
     <!--input type='text' name='liveagent.prechat:ContactLastName' id='lastName' /><br /-->
     <!--input type='text' name='liveagent.prechat:ContactEmail' id='email' /><br /-->
    Phone: <input type='text' name='liveagent.prechat:AccountPhone' id='phone' /><br />
    Issue: <!--input type='text' name='liveagent.prechat:AccountDescription' id='subject' /--><br />

<!-- Hidden fields used to set additional custom details -->
    <input type="hidden" name="liveagent.prechat:AccountDescription" value="New-jkknj" /><br />
    <input type="hidden" name="liveagent.prechat:AccountRecordType" value="012a000000188SM" />
    <input type="hidden" name="liveagent.prechat.name" id="prechat_field_name" />

<!-- map: Use the data from prechat form to map it to the Salesforce record's fields -->
<input type="hidden" name="liveagent.prechat.findorcreate.map:Account" value="Name,AccountName;Phone,AccountPhone;Description,AccountDescription;RecordType,'(!AccountRecordType)'"/><!--,AccountDescription;
<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Account" value="Phone,true" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Account" value="Phone,true" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Account" value="Name,true;Phone,true;Description,true;RecordTypeId,True"/><!--;Bill_Street_1__c,true;
LastName,true;IsPersonAccount,true" /-->
<input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Account" value="true" />
<!--input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Case" value="true" /-->

<!-- saveToTranscript: Associates the records found / created, i.e. Contact and Case, to the Live Chat Transcript record. --> 
<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Account" value="AccountId" />
<input type='submit' value='Chat Now' id='prechat_submit' onclick="setName()"/>

<!-- Set the visitor's name for the agent in the Console to first and last name provided by the customer -->
<script type="text/javascript">
   function setName() {
    document.getElementById("prechat_field_name").value =  
        document.getElementById("firstName").value;
    }
</script>

<style type="text/css">
p {font-weight: bolder }
</style>

</form>

thanks 

nizam