So we're using the liveagent.findOrCreate
Deployment APIs to initiate our Live Agent Chats. We are not calling the liveagent.prechat versions and are having issues finding already existing Accounts.
Our example is very much like the Salesforce Code Example found here: Code sample
Setup:
- Live Agent Deployment with Omni Channel Routing
Scenario:
Omni routing works to push the Chat Transcript to the correctly signed in agent for that Queue; however, everytime, the Chat Transcipt loads, and a new Account is created, even when the Account already exists.
Here is the code:
liveagent.setName(profile.firstName + ' ' + profile.lastName);
liveagent.addCustomDetail('Email', profile.email);
liveagent.findOrCreate('Contact').map('Email','Email',true,true,true);
liveagent.findOrCreate('Contact').saveToTranscript('ContactId').showOnCreate().linkToEntity('Case','ContactId');
liveagent.addCustomDetail('Case Subject','Live chat');
liveagent.findOrCreate('Case').map('Subject','Case Subject',false,false,true).saveToTranscript('CaseId').showOnCreate();
liveagent.addCustomDetail('Account name', profile.establishment.companyName);
liveagent.findOrCreate('Account').map('Name','Account name',false,false,true).saveToTranscript('AccountId').showOnCreate().linkToEntity('Case','AccountId');
Thoughts? Much appreciated.