In Salesforce, picklist fields can accumulate inactive (deactivated) values over time. The Setup UI only displays up to 1,000 picklist values, which means additional inactive values may exist in the metadata but remain invisible in the UI. When an admin attempts to create a new picklist value based on an existing inactive value they cannot see, a Duplicate Value error occurs.
This article explains how to reactivate deactivated picklist values using the Salesforce Metadata API without needing to create new values.
package.xml file in a text editor. The file should specify the API version and the object whose picklist values you want to retrieve. For example, to retrieve the Lead object, set the <members> element to Lead and the <name> element to CustomObject. Use API version 37.0 or later.<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <version>37.0</version> <types> <members>Lead</members> <name>CustomObject</name> </types> </Package>
package.xml to retrieve the object metadata from your org. Unzip the retrieved package, preserving the folder structure.objects folder). Search for the picklist field definition. The field entry contains <fullName>, <picklist>, and <picklistValues> elements. Each active value has a <fullName> and <default> element. Inactive values have the same structure but may include an <isActive>false</isActive> element.<fields> <fullName>TestPicklistField</fullName> <picklist> <picklistValues> <fullName>Service</fullName> <default>false</default> </picklistValues> <picklistValues> <fullName>Sales</fullName> <default>false</default> </picklistValues> <picklistValues> <fullName>Marketing</fullName> <default>false</default> </picklistValues> </fields>
<picklistValues> entry so that it does NOT contain <isActive>false</isActive>. If the entry is missing entirely, add a new entry with the value's <fullName> and <default>false</default>.<picklistValues> <fullName>Inactive Value</fullName> <default>false</default> </picklistValues>
.zip file (with a different name than the original), and deploy it back to the org using the Metadata API deploy method. The inactive picklist values will now appear as active in the org.Salesforce Metadata API Developer Guide — File-Based Retrieve and Deploy
000382794

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.