• Carlos Castillo 23
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I am implementing Live Agent in an environment using PersonAccounts. I am deploying it via snap-ins in Lightning. I use the snap-in prechat page with the Service Scenario - Associate chats with contacts and cases.

When using this, it works, but it shows Contact records instead of Account records (when using Person Accounts these are technically identical, but Contact page layout doesn't display the information I need and this information is on the Person Account page layout) and it also creates new contacts if the chat visitor is unkown - creating a new contact/account is not desired.

To display a PersonAccount record and not to create a new record if the visitor is unkown I use the following custom extraPrechatInfo and extraPrechatFormDetails:
 
embedded_svc.settings.extraPrechatInfo = [{"entityFieldMaps":[{"doCreate":false,"doFind":false,"fieldName":"LastName","isExactMatch":false,"label":"Last Name"},{"doCreate":false,"doFind":false,"fieldName":"FirstName","isExactMatch":false,"label":"First Name"}, {"doCreate":false,"doFind":false,"fieldName":"Email","isExactMatch":false,"label":"Email"}],"entityName":"Contact","saveToTranscript":"","showOnCreate":false},{"entityName":"Account","showOnCreate":false,"entityFieldMaps":[{"isExactMatch":true,"fieldName":"PersonEmail","doCreate":false,"doFind":true,"label":"Email"},{"isExactMatch":true,"fieldName":"Brand__c","doCreate":false,"doFind":true,"label":"VisitorBrand"}]},{"entityFieldMaps":[{"doCreate":true,"doFind":false,"fieldName":"Subject","isExactMatch":false,"label":"Subject"},{"doCreate":true,"doFind":false,"fieldName":"SuppliedEmail","isExactMatch":false,"label":"Email"}, {"doCreate":true,"doFind":false,"fieldName":"SuppliedName","isExactMatch":false,"label":"Last Name"},{"doCreate":true,"doFind":false,"fieldName":"Origin","isExactMatch":false,"label":"CaseOrigin"}],"entityName":"Case","saveToTranscript":"Case","showOnCreate":true}];
embedded_svc.settings.extraPrechatFormDetails = [{"label":"Last Name", "transcriptFields": ["Last_Name__c"]},{"label":"First Name", "transcriptFields": ["First_Name__c"]},{"label":"Subject", "transcriptFields": ["Subject__c"]},{"label":"Email", "transcriptFields": ["Email__c"]},{"label":"VisitorBrand","value":"2","transcriptFields":[],"displayToAgent":true},{"label":"CaseOrigin","value":"Chat","transcriptFields":[],"displayToAgent":true}];
It works fine in the DEV sandbox but in the TEST sandbox it doesn't search for the account if the chat is coming from a known visitr = existing account. No errors are visible in the debug logs.

Do you have an idea what might be causing this?