3

I am looking for a way to deactivate 700 picklist values (not manually)

I do NOT want to delete the values, only deactivate them

I am trying with ant migration tool with this package.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Lead.LeadSource</members> 
        <name>CustomField</name>
    </types>
    <types> 
        <members>LeadSource</members> 
        <name>StandardValueSet</name> 
    </types> 
    <version>43.0</version>
</Package>

I get the metadata successfully but only the activated values, so I don't know how to get or set the values to be deactivated.

QUESTION

  1. Is this possible via ant?

  2. Any other way to do that?

UPDATE

This is the output I get after running the above package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<StandardValueSet xmlns="http://soap.sforce.com/2006/04/metadata">
    <sorted>true</sorted>
    <standardValue>
        <fullName>Webinar_RealTime_September2011</fullName>
        <default>false</default>
        <label>Webinar_RealTime_September2011</label>
    </standardValue>
    <standardValue>
        <fullName>WebinarTailoringSearchResults</fullName>
        <default>false</default>
        <label>WebinarTailoringSearchResults</label>
    </standardValue>
    <standardValue>
        <fullName>Website</fullName>
        <default>false</default>
        <label>Website</label>
    </standardValue>
</StandardValueSet>
4
  • In the Ant output do you get the active/inactive tag? you can just it to inactive and it would deactivate them in the org
    – RedDevil
    May 16, 2019 at 7:46
  • @RedDevil - no, I do not get this option - I have updated my question with the output May 16, 2019 at 7:47
  • if you check this link can you add isative as false and push it back to the org to see what happens
    – RedDevil
    May 16, 2019 at 8:09
  • @RedDevil - yes, this works, actually - if I deploy the StandardValueSet with a new set of values - it will put all values that it did not find as deactivated, also - as you suggested, if I put `isActive=flase' on a value, it also deactivates it upon deploy. do you want to write this as an answer so I can mark it? May 16, 2019 at 8:42

1 Answer 1

6

Set the isactive attribute to false and deploy those values back using ant.The values will be made inactive

Check documentation here

Example to set 2 values as inactive:

<?xml version="1.0" encoding="UTF-8"?>
<StandardValueSet xmlns="http://soap.sforce.com/2006/04/metadata">
    <sorted>true</sorted>
    <standardValue>
        <fullName>Webinar_RealTime_September2011</fullName>
        <default>false</default>
        <label>Webinar_RealTime_September2011</label>
        <isActive>false</isActive>
    </standardValue>
    <standardValue>
        <fullName>WebinarTailoringSearchResults</fullName>
        <default>false</default>
        <label>WebinarTailoringSearchResults</label>
        <isActive>false</isActive>
    </standardValue>
    <standardValue>
        <fullName>Website</fullName>
        <default>false</default>
        <label>Website</label>
    </standardValue>
</StandardValueSet>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .