mattandneil / statecodes

Automatically creates all ~5000 values for state and country picklists

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploy to Salesforce This tool initializes all ISO states by screen scraping the forms in setup.
(State and Country picklist values cannot be created any other way)

Install

Verify

Inspect the State and Country picklist values before, during, and after starting the batch:

Modify

After the package creates all the state codes and state names, the values must be permanently activated using Workbench or an IDE connected to the org. Follow these steps in sandbox before attempting in production:

  1. Install the package in sandbox, not production
  2. Go to Installed Packages > Configure > Run Batch
  3. Use any text editor to create a package.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <Package>
        <types>
            <members>Address</members>
            <name>Settings</name>
        </types>
        <version>45.0</version>
    </Package>
    
  4. In Workbench, go to Migration > Retrieve, use package.xml
  5. Download the result and unzip its contents into a new folder
  6. Open the Address.settings file in your text editor
  7. Replace all <active>false</active> with <active>true</active>
  8. Replace all <visible>false</visible> with <visible>true</visible>
  9. Save changes, then zip up the exact contents of the folder again
  10. In Workbench, go to Migration > Deploy, and deploy the new zip file

While we can't provide ad-hoc support for this code, please contact us with your company
name and address if you need a warranty for its use and we will assist: www.streamscript.com/contact

About

Automatically creates all ~5000 values for state and country picklists


Languages

Language:Apex 100.0%