A different way to tackle this need is to manage picklist values through Metadata API. Metadata API can also be used for managing fields, objects, pages etc. but our interest here lies in the picklists. Suggested usage would be to create/delete picklist values in a trigger or batch job. For the sake of simplicity the sample code presented here manages picklist values in VisualForce pages and attached controllers.
Interesting code parts for adding and deleting can be found in the addPicklistValue, deletePicklistValue methods. MetadataService.MetadataPort object is created first. The existing picklist is read as a custom field through the readMetadata method. Picklist value is added/deleted and the whole custom field is then updated with the updateMetadata method.
When installing the Apex wrapper for Metadata API, there are a few things to take into consideration. In order to access Metadata API in Apex code, the Apex wrapper has to be installed into the sandbox. You can find the Apex wrapper for example in https://github.com/financialforcedev/apex-mdapi. Click the “Deploy to Salesforce” button and deploy the package into your sandbox.
After installation, you should enable the remote site access in the setup menu: Setup -> Security Controls -> Remote site settings and add the sandbox url. Below you can find an example of the page and controller codes to use as an inspiration for your own work.
Salesforce is a rich, powerful and evolving platform. Using Metadata API can further expand the capabilities of Salesforce as a platform. Especially existing solutions can be extended in new ways with Metadata API in places where standard approach does not work when fulfilling customers requirements.