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.
copy data from lead to item record
Hello,
I added a custom field in a lead form, contains an item internal ID, then I created a script that will run on a customer saved search, Load each lead, and retrieve the item internal ID from the custom field, Load that item and copy email from the lead to an item custom field, but if the item custom form contains data, it will cancatinate it with the new data, the code as following:
function addInfoFromLead()
{
var searchresults = nlapiSearchRecord( 'customer', 179 , null, null );
for (var itemcount=0 ; itemcount < searchresults.length ; itemcount++)
{
var lead = nlapiLoadRecord(searchresults[itemcount].getRecordType(),searchresults[itemcount].getId());
0