• Woomastol Woomastol
  • NEWBIE
  • -1 Points
  • Member since 2020
  • Preet Adro Industries
  • LTD

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    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()"/>