More than 5 years ago I wrote an article on how to Mass delete Picklist values in Salesforce, this is still my most visited article and I have been meaning to get back to it for years. At least now it seems like it will be a part of the standard functionality sometime in the near future (mass delete picklist values (setup)) but today I had to do this at a customer so I had to solve it once again.
It works out of the box in Classic but it’s very quiet about what’s happening and you don’t really know what’s happening. Also if you accidentally clicked the bookmark in a production environment you’re going to have a bad time
You can still load it from where I store it by creating a bookmark with this URL:
Clicking it on a Global Value Set Detail page will give you a prompt:
Clicking ok will go ahead and select the inactive Picklist values and prompt again:
Clicking Cancel will abort at all times.
Clicking on on this last Confirmation dialogue will delete your Inactive picklist values and the page will refresh.
If you want to delete Active Picklist values you'll have to change the "Inactive" string to "Active" after clicking the bookmark:
Same thing will happen next, you're asked to confirm:
Picklists are deleted and page reloaded. If you have a lot of values it might take some time so starting up the Developer Console is not a bad idea:
Deleting #262: https://mydomain--sandboxname.csXX.my.salesforce.com/setup/ui/picklist_masterdelete.jsp?id=01J0E000006zu8g&tid=0Nt&pt=0Nt0E0000000RFx&retURL=%2F0Nt0E0000000RFx&deleteType=0&_CONFIRMATIONTOKEN=VmpFPSxNakF4T0Mwd09TMHhORlF4TXpvd016bzBPUzR4TmpWYSxEY29WbGQtQUZ2NFM1SFM0Y3ZvNUpmLFpXSXdPRFZq massdelete_v2.js:39 Deleting #263: https://mydomain--sandboxname.csXX.my.salesforce.com/setup/ui/picklist_masterdelete.jsp?id=01J0E000006zu8h&tid=0Nt&pt=0Nt0E0000000RFx&retURL=%2F0Nt0E0000000RFx&deleteType=0&_CONFIRMATIONTOKEN=VmpFPSxNakF4T0Mwd09TMHhORlF4TXpvd016bzBPUzR4TmpWYSxkbHZYWnlodjdFT0xLb0lUT3FaNzJlLFpqUTNNV1Uw massdelete_v2.js:39 Deleting #264: https://mydomain--sandboxname.csXX.my.salesforce.com/setup/ui/picklist_masterdelete.jsp?id=01J0E000006zu8i&tid=0Nt&pt=0Nt0E0000000RFx&retURL=%2F0Nt0E0000000RFx&deleteType=0&_CONFIRMATIONTOKEN=VmpFPSxNakF4T0Mwd09TMHhORlF4TXpvd016bzBPUzR4TmpWYSxmd0xkOFBUN1F0VHRkUmlVNmsxQUl0LFltVXlZVE16 massdelete_v2.js:39 Deleting #265: https://mydomain--sandboxname.csXX.my.salesforce.com/setup/ui/picklist_masterdelete.jsp?id=01J0E000006zu8j&tid=0Nt&pt=0Nt0E0000000RFx&retURL=%2F0Nt0E0000000RFx&deleteType=0&_CONFIRMATIONTOKEN=VmpFPSxNakF4T0Mwd09TMHhORlF4TXpvd016bzBPUzR4TmpaYSwxdnZiTndrNFFIN0R4UEU0SzhBZDM3LE1qSXpZalpq massdelete_v2.js:39 Deleting #266: https://mydomain--sandboxname.csXX.my.salesforce.com/setup/ui/picklist_masterdelete.jsp?id=01J0E000006zu8k&tid=0Nt&pt=0Nt0E0000000RFx&retURL=%2F0Nt0E0000000RFx&deleteType=0&_CONFIRMATIONTOKEN=VmpFPSxNakF4T0Mwd09TMHhORlF4TXpvd016bzBPUzR4TmpaYSw5QmxpX1BueEF1SDdSUVRDUHhic2FsLE9XVXdNRFF3 massdelete_v2.js:39 Deleting #267: https://mydomain--sandboxname.csXX.my.salesforce.com/setup/ui/picklist_masterdelete.jsp?id=01J0E000006zu8l&tid=0Nt&pt=0Nt0E0000000RFx&retURL=%2F0Nt0E0000000RFx&deleteType=0&_CONFIRMATIONTOKEN=VmpFPSxNakF4T0Mwd09TMHhORlF4TXpvd016bzBPUzR4TmpaYSx2bjdkSUxRamljYUR4dTBlZzlSMmYyLFlqY3pNR016
I deleted 350 picklist values in just over 2 minutes so it will not take forever, next step for this script would be to add a spinning progressbar and some bells and whistles but for now this at least solves the problem.
Since you need to have at least 1 value in a Value Set it will not be able to delete all of the Active picklist values but at least you'll save some mouse clicks.
You'll get a warning in the browser that synchronous XML requests are deprecated:
Running the requests asynchronous works fine but the browser will be super swamped if you're deleting hundreds of picklist values so this one is better. When the day finally comes and support for synchronous XML requests are removed I'll make sure to update this but until then this hack is good enough.