Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
NetSuite has launched SuiteSuccess Wholesale Distribution Edition, in Japan. Please join us the webinar on February 12 that introduces NetSuite solution with demos and case studies for Wholesale Industry.
Register Now
Copy an Existing Customer Record
Hi,
I am trying to use the nlapiCopyRecord function to make a copy of an existing customer record and save it as a child record of that existing customer.
When my newly copied customer object is saved via the nlapiSubmitRecord function I get a duplicate error.
This appears to be due to the internal ID being copied with the other information from the source customer record.
Here is a snippet:
//////////////////////////
currentRecord = nlapiLoadRecord('customer',custIDArray[i]);
//custIDArray[i] is the internalID of a customer record returned in a searchresult.
var newID = currentRecord.getFieldValue('entityid') + 'E';
newRecord = nlapiCopyRecord('customer',currentRecord.getId());
newRecord.setFieldValue('entityid',newID);