Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Please note that on Saturday, April 11, 2026, at 8:00 PM Pacific time, our Case Management System will undergo a scheduled maintenance for approximately 30 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
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:
Tagged:
0