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.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Please note that on Friday, March 20, 2026, at 8:00 PM Pacific time, our Case Management System will undergo a scheduled maintenance for approximately 4 hours. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
Difficulty adding new address
Hi, everyone. Hopefully this is a simple fix that I'm just not seeing.
I am trying to set up a client script on customers such that when you create a new customer and select a parent, the parent's default billing address is automatically copied to this new customer. Here's my code:
var parent = nlapiLoadRecord("customer", nlapiGetFieldValue("parent") ); for( var i = 1, lineCount = parent.getLineItemCount("addressbook") ; i <= lineCount ; i++ ) { if( parent.getLineItemValue("addressbook", "defaultbilling", i) == "T" ) { nlapiSelectNewLineItem("addressbook"); nlapiSetCurrentLineItemValue("addressbook", "defaultbilling", "T"); nlapiSetCurrentLineItemValue("addressbook", "attention", parent.getLineItemValue("addressbook", "attention", i)); nlapiSetCurrentLineItemValue("addressbook", "addressee", parent.getLineItemValue("addressbook", "addressee", i)); nlapiSetCurrentLineItemValue("addressbook", "phone", parent.getLineItemValue("addressbook", "phone", i)); nlapiSetCurrentLineItemValue("addressbook", "zip", parent.getLineItemValue("addressbook", "zip", i)); try { nlapiSetCurrentLineItemValue("addressbook", "addr1", parent.getLineItemValue("addressbook", "addr1", i)); } catch (e) {}; nlapiSetCurrentLineItemValue("addressbook", "addr2", parent.getLineItemValue("addressbook", "addr2", i)); nlapiSetCurrentLineItemValue("addressbook", "city", parent.getLineItemValue("addressbook", "city", i)); nlapiSetCurrentLineItemValue("addressbook", "state", parent.getLineItemValue("addressbook", "state", i)); nlapiSetCurrentLineItemValue("addressbook", "country", parent.getLineItemValue("addressbook", "country", i)); nlapiCommitLineItem("addressbook"); } } 0