You need to sign in to do that
Don't have an account?
LiveAgent findOrCreate.map.doCreate - will it work with Person Accounts
The documentation at http://developer.chatter7bk.com/docs/atlas.en-us.salesforce1api.meta/salesforce1api/live_agent_creating_records_prechat_API_doCreate.htm gives the example of a contact and http://peterknolle.com/live-agent-pre-chat-api/ gives some really good code examples (again for contacts) but my org is using person accounts almost exclusively. Does it work with person accounts and does anybody know the syntax?
<input type="hidden" name="liveagent.prechat.findorcreate.map:Account" value="FirstName,First Name;LastName,Last Name;PersonEmail,Email;BillingPostalCode,Zip;Type,Customer Type;RecordTypeId,'{!PersonRTId}'" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Account" value="FirstName,true;LastName,true;PersonEmail,true;BillingPostalCode,true;Type,true;RecordTypeId,true" />
<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Account" value="AccountId" />
When the record is created it will return the AccountId, the ContactId is always null for the new Person Account. We've had problems linking the new Person Account to a Case using the PreChat API. The Account is assigned, but the Contact is null. To get around this, we have a trigger on the Case to update the Contact Id if the Account is a person account.
All Answers
<input type="hidden" name="liveagent.prechat.findorcreate.map:Account" value="FirstName,First Name;LastName,Last Name;PersonEmail,Email;BillingPostalCode,Zip;Type,Customer Type;RecordTypeId,'{!PersonRTId}'" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Account" value="FirstName,true;LastName,true;PersonEmail,true;BillingPostalCode,true;Type,true;RecordTypeId,true" />
<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Account" value="AccountId" />
When the record is created it will return the AccountId, the ContactId is always null for the new Person Account. We've had problems linking the new Person Account to a Case using the PreChat API. The Account is assigned, but the Contact is null. To get around this, we have a trigger on the Case to update the Contact Id if the Account is a person account.
I'm guessing that the key,value; groupings would look something like
<input type="hidden" name='liveagent.prechat:First Name' value="{!sFirstName}"/>
<input type="hidden" name='liveagent.prechat:Last Name' value="{!sLastName}"/>
<input type="hidden" name='liveagent.prechat:Email' value="{!sEmail}"/>
<input type="hidden" name='liveagent.prechat:Zip' value="{!sZip}"/>
<input type="hidden" name='liveagent.prechat:Customer Type' value="{!sUserType}"/>
<input type="hidden" name='liveagent.prechat:Company' value="{!sCompany}"/>
<input type="hidden" name='liveagent.prechat:Button' value="{!sRecordType}"/>