Loading

Error 'Duplicate Values' for a new, unique picklist value

Date de publication: May 22, 2023
Description
 In sandbox as the result of the user who created or last modified the picklist value is not copied over to the sandbox as a part of the refresh, such as portal or community users as outlined in the Sandbox Setup Tips and Considerations,

"The copy process doesn’t copy Contact data to Developer or Developer Pro sandboxes. Therefore, Customer Portal users aren’t copied. However, the copy process does copy the Customer Portal licenses, so you can create Customer Portal users in these sandboxes as needed."

If a record is created with a picklist value that doesn't exist, that picklist value is automatically added to a list of inactive picklist values for the field. This is outlined in the SOAP API Developer's Guide documentation for the Picklist Field Type,

"The API does not enforce the list of values for advisory (unrestricted) picklist fields on create() or update(). When inserting an unrestricted picklist field that does not have a PicklistEntry, the system creates an "inactive" picklist value. This value can be promoted to an "active" picklist value by adding the picklist value in the Salesforce user interface."

So in this circumstance, a user who does not typically have permission to directly create a picklist value via setup may be able to create one by inserting or creating a record that contains a non existent picklist value.

If the inactive value is then made official or active by adding it to the field's setup it will maintain the portal or community user's details in the created by system field for the picklist value.
Résolution


To correct this behavior for issue,you will need to log a case with Salesforce Support with reference to this knowledge article.


Support will need to run a fix to address this unexpected issue in the affected sandbox(es). To help expedite case handling please provide and confirm the following details in your case's description:


- Sandbox org Id:

- Link to affected picklist's setup section:

- Picklist values you're unable to add due to the duplicate value error:

- Steps to reproduce the behavior and your permission for Support to do so in the affected environment

- Permission to run the fixer in the affected and provided sandbox org Id:

- Affected sandbox's related production org Id:

- Ask Support to reference the internal information section of this article.

- Grant login access as a System Administrator in the affected sandbox(es) and their related production org. See How to Grant Login Access to a Salesforce Success Agent.

To resolve the underlying cause of the issue and to prevent future sandboxes from being affected, it's necessary to delete, replace, and re-create the affected picklist values in the field's setup section within the sandbox's related production environment. Note that when you delete a picklist value, the value is not actually deleted from Salesforce and instead is retained as an inactive picklist value. When you re-create it or add it again after it has been 'deleted' the inactive picklist value is made active again.

So you will need to deactivate the value and then delete it to properly re-create it and input a proper Salesforce user's details into the created by audit field for the picklist value. First create a placeholder picklist value, then Manage Inactive Values in Unrestricted Custom Picklists to delete the affected picklist value and choose to replace it with the placeholder value, then recreate the affected value again and deactivate/delete/replace the placeholder value with it.

To fix the behavior in affected sandboxes Support will need to manually run a fixer which should then allow you to re-activate the affected picklist value via it's setup section as outlined in the article mentioned under 1) above or via a Metadata API deploy operation. The details for this are outlined in the article, Metadata deploy to reactivate deleted (inactive) picklist values.

If the error is being received in a picklist value set related to an object from another package, please log the same case to Salesforce Support to clear the duplicate. But as prevention, please do not let users who are not assigned with the license of the package in question to delete picklist values within the value set in question. This will not cascade into the backend, causing it to linger and get detected as 'Duplicate Value' should it be added back in the future.

See also:
Numéro d’article de la base de connaissances

000387973

 
Chargement
Salesforce Help | Article