ANS-1011 · WEB SERVICES & INTEGRATIONS
How to Programmatically Retrieve the List of States in NetSuite?
NetSuite administrators can programmatically access the complete list of states, provinces, and counties configured within their company settings using web services.
Short answer
The list of states, provinces, and counties defined in NetSuite's Setup - Company - States/Provinces/Counties can be retrieved using the `getAll` web service operation. This operation accepts `'states'` as an argument, which then returns the configured list directly from the company setup.
Scenario
Users often need to programmatically access the comprehensive list of states, provinces, and counties that have been configured within their NetSuite environment. This information is crucial for various integrations, custom scripts, or reporting purposes, ensuring data consistency with the company's defined geographical settings.
Solution
To retrieve the list of states, provinces, and counties defined in NetSuite's Setup - Company - States/Provinces/Counties, the getAll web service operation can be utilized. This operation allows for programmatic access to the configured geographical data. The getAll web service operation should be invoked, passing 'states' as an argument. This will return the complete list of states as defined in the company setup. For detailed information on how to set up and execute such a query, refer to the following resource: https://usergroup.netsuite.com/users/showthread.php?t 821
Expert NetSuite Support
Need help with this NetSuite issue?
Web Services & Integrations consulting and configuration support
