Discussions
SuiteWorld is the largest annual gathering of the NetSuite community! It will be held in Las Vegas on October 6-9, 2025. Our customers and partners look forward to SuiteWorld every year as a place to hear the latest from NetSuite, get hands-on learning, and connect with each other. Register now!
Why can't I set the state for an address using a script?
Hi
I am trying to create an address subrecord using a map reduce script.
Most of it works fine other than:
- It is not possible to set the state field
The relevant lines in the script are:
var leadId = inputData.id
var address1 = inputData.values['custentity_shipping_address_1']
var address2 = inputData.values['custentity_shipping_address_2']
var city = inputData.values['custentity_shipping_address_city']
var state = inputData.values['custentity_shipping_address_state'].value
var postCode = inputData.values['custentity_shipping_address_postcode']
Based on the debug log, this is returning the internal id of the state.
However, it appears as: