Working with Salesforce Duplicate Rules (S4S Experience Forms)
When submitting data to Salesforce with S4S Experience Forms, it is possible that submissions will fail if Salesforce Duplicate Rules are implemented in Salesforce. Setting the S4SMapping.EnableDuplicateAllowSave value to ‘true’ in the \App_Config\Modules\S4S\S4S.config file will force the record to be saved by ignoring any Salesforce Duplicate Rules.
Example
By default, Salesforce implements the following Standard Duplicate Rules - https://help.salesforce.com/articleView?id=duplicate_rules_standard_rules.htm&type=5
If you have a Contact with an email value of ‘john@doe.com’ and a Lead is submitted with an email value of ‘john@doe.com’ then by default, the submit action will fail because Salesforce will detect a duplicate and offer to match the existing Contact record. However, this can not be handled effectively in the Submit Action.
There are 3 courses of action to handle this in S4S Experience Forms:
Set the S4SMapping.EnableDuplicateAllowSave value to ‘true’ in \App_Config\Modules\S4S\S4S.config:
<!--Overide duplicate rules to create new object --> <setting name="S4SMapping.EnableDuplicateAllowSave" value="false"/>
Configure the S4S Experience Forms error handling to email form values to enter manually into Salesforce so the duplicate rules can be applied. See the following link for more information - Error Handling
Create a custom submit action and implement code to process the Salesforce record matches that are returned in the FailedSaveResults collection. See the following code sample for more information - Custom submit action code sample - Without Sitecore Analytics
Next Step
Congratulations, you have finished installing this option.