Fix the “Please Enter Value(s) for: Address” SuiteScript Error
Getting the “Please enter value(s) for: Address” error in SuiteScript? Learn how reverse iteration prevents addressbook sublist indexing issues when removing customer addresses.
Date
October 28, 2026
Read
5 min
Fix the “Please Enter Value(s) for: Address” SuiteScript Error
When removing customer address lines using SuiteScript 2.x, you may encounter the error “Please enter value(s) for: Address.”
One possible cause is the way your script iterates through the customer's addressbook sublist.
If you remove a line while looping forward through the sublist, the remaining lines shift positions. Your script may then attempt to access an incorrect line index or skip an address.
A simple way to avoid this indexing problem is to iterate through the sublist backward, from the last line to the first.
Why Removing Address Lines Can Cause Problems
NetSuite's record.removeLine() method removes a line from a sublist.
When that happens, the remaining lines are reindexed.
For example, suppose a customer has four address lines:
Original index
Address
0
Address A
1
Address B
2
Address C
3
Address D
If your script removes Address B at index 1, the remaining addresses shift:
New index
Address
0
Address A
1
Address C
2
Address D
Address C is now at index 1 rather than index 2.
A forward loop that continues incrementing its index may skip Address C or eventually attempt to access a line that no longer exists.
This is particularly problematic when a script needs to inspect and potentially remove multiple address lines.
Solution: Iterate Through the Addressbook Backward
Instead of looping forward:
for (var i = 0; i < addressLines; i++) {
// Process address line
}
Loop backward:
for (var i = addressLines - 1; i >= 0; i--) {
// Process address line
}
When you remove a line while iterating backward, the indices of the remaining unprocessed lines do not change.
This allows your script to continue examining the preceding address lines without skipping them.
The script uses record.load() to retrieve the customer record and its addressbook sublist.
Get the address line count
The getLineCount() method determines how many addresses are associated with the customer.
Loop from the last line to the first
The loop starts at addressLines - 1 and decrements the index after each iteration.
Check whether an address is temporary
The script reads custrecord_temp_address from the address subrecord.
This is an example of an implementation-specific custom field. The field ID and its availability depend on your NetSuite configuration.
Remove temporary addresses
When the temporary-address flag is true, removeLine() removes the addressbook entry.
The continue statement moves the loop to the next address without attempting to update the removed line.
Identify the default shipping address
For addresses that remain, the script checks the address label.
If the normalized label is delivery, the script sets the addressbook line's defaultshipping field to true.
Save the customer record
After processing the addressbook, the script saves the customer record.
What If the Address Error Still Appears?
Reverse iteration prevents a specific class of sublist indexing problems. However, the error message may also occur when NetSuite encounters invalid or incomplete address information.
If the error continues, investigate the following possibilities.
1. Missing Mandatory Address Information
Check whether any remaining address subrecords are missing required values.
The required fields may depend on the country and the account's address configuration.
2. Incorrect Address Subrecord Field IDs
Confirm that the script references the correct fields on the address subrecord.
The custom field custrecord_temp_address must exist and be accessible in the relevant configuration.
3. An Invalid Default Shipping Address
Review whether the script is assigning the default shipping flag to an address that remains on the customer record.
If no remaining address has the expected label, the script may leave the customer without the intended default shipping address.
4. Standard Mode vs. Dynamic Mode
The example uses standard-mode record APIs, including getSublistValue() and setSublistValue().
If your script loads the record in dynamic mode, the sublist editing approach may need to change.
5. Record Save Validation
An error may occur during customerRecord.save() rather than during removeLine().
If the loop completes but saving fails, inspect the remaining address subrecords and any mandatory-field requirements.
Final Thoughts
When removing lines from a NetSuite sublist, iterating backward is a useful way to avoid index-shifting problems.
Instead of starting at index 0 and moving forward, begin with the last line and work toward the first.
This approach is useful when deleting customer addressbook entries and can also be applied to other sublists where multiple lines need to be removed.
If the “Please enter value(s) for: Address” error persists after changing the loop, review the address data and record validation requirements to identify the underlying cause.
Deciding the right ERP system to use is a challenging task, but once you decide to purchase it, you will need to know some key details to get moving. Here are 13 things you need to know about NetSuite before or after you purchase the system.
In this episode, Michael and Caleb break down the three most important things NetSuite users should be doing to start 2026 strong. From auditing your processes and leveraging integrations to implementing customer portals that actually save time.
Explore the complete NetSuite modules list, including ERP, CRM, finance, manufacturing, and industry add-ons. Anchor Group provides consulting, licensing, and implementation for all Oracle NetSuite modules and add-on solutions.
Medical Innovations built the operational foundation to scale without adding headcount—and they're using automation, integrations, and AI to move faster than competitors hundreds of times their size. (Yes, really.)