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:

  1. 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"/>

     

  2. 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 - https://fuseit.atlassian.net/wiki/spaces/S4S/pages/862879745

  3. 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 - https://fuseit.atlassian.net/wiki/spaces/S4S/pages/320929850

Next Step

Congratulations, you have finished installing this option.