This article is relevant if you are seeking to have a country list and a state list that is used in NetSuite SuiteScript environments.
Background
During development of a NetSuite custom recurring billing engine for a client, while working on the SuiteScript Server Pages to collect credit cards, we needed a list of countries and associated state names for both United States and Canada with values that would feed into our custom REST API to create a customer billing addresses record. The client wanted to limit the countries it would do business with. We need to supply NetSuite’s country list so that it could be pared down.
In performing this work, we recognized that we could start with the elements that NetSuite provided us to start with. Hence, we used the technique that any good HTML developer does to “Inspect Element” to learn about the construction of a webpage. Indeed, NetSuite has an array of countries and related states. We inspected these elements, made some minor refinements, and have included them here for your download into your JavaScript libraries.
Get Country List and Related State List in JSON / JavaScript format
The official Country List maintained by the ISO standard body is here. But you can use this list here:
https://blog.prolecto.com/wp-content/uploads/2015/03/netsuite-country-state-list-20150330.js
Develop Custom NetSuite Solutions
Don’t let built-in NetSuite features and documented APIs get in the way of your needed software solution. Contact us if you seek to push NetSuite farther to solve real business problems.