+ Start a Discussion
Viacheslav DiatkkoViacheslav Diatkko 

Pre-chat Form: Disable creating Contacts on each chat

Hi Everyone!

I need to disable creating Contacts from pre-chat form. According to the Salesforce documentation it's possible with this code:

embedded_svc.settings.extraPrechatInfo = [{"entityFieldMaps":[{"doCreate":false,"doFind":true,"fieldName":"LastName","isExactMatch":true,"label":"Last Name"},{"doCreate":false,"doFind":true,"fieldName":"FirstName","isExactMatch":true,"label":"First Name"}, {"doCreate":false,"doFind":true,"fieldName":"Email","isExactMatch":true,"label":"Email"}],"entityName":"Contact","saveToTranscript":"Contact","showOnCreate":true}];
I tried it out in my dev org with a visualforce page and in my customer's  sandbox with a dummy website, and it didn't work.  Contacts are still created. However it works for other parameters. E.g. setting "saveToTranscript" to an empty string disables saving contacts to transcript in the Console. 
Does anybody has an idea, how I can disable creating contact, when the pre-chat form is submitted by visitor. 

Thanks in advance!
David Ankori 16David Ankori 16
We have encountered a similar problem - but it seems that this happens only when using the chat from Safari browser. Can you please confirm? 
Per SwardhPer Swardh

I managed to solve this by making a simple workaround and created a validation rule on the Contact object forcing it to have the AccountId set.

Let me know if it helps and is a acceptable solution.
Maaike MinMaaike Min

Hi, we encountered the same problem, and with us it was due to the language settings. If you do not set any, the chat will default to the browsers' language, but the codes' labels are not translated.

Try setting the chat language to English:

embedded_svc.settings.language =  'en-US';

Or set your preferred language, and copy the label-names, in this example its Dutch (nl-NL)

Label name should be in the chat language