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 18, 2026, at 8:00 PM Pacific Time, our Case Management System will undergo a scheduled maintenance for approximately 15 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
Sales Order number "To be Generated"
Since NetSuite lacks a unique identifier for each itemline from a Sales Order, I need to create it myself
I decided to use a concatenation of the internal id + a random generated number between one and one billion.
In order to do so, I used a post-submit server side script:
function generateRadId() { var lineitemcount = nlapiGetLineItemCount('item'); var internalid = nlapiGetRecordId(); for (var i = 0; i < lineitemcount; i++) { var linenumber = eval(i+1); var randomnumber = Math.floor(Math.random()*1000000001); var generatednumber = eval(internalid+randomnumber); nlapiSetLineItemValue('item', 'custcol_radid', linenumber, generatednumber); debug(generatednumber); } function debug(str) { nlapiLogExecution('DEBUG', 'debug', str) } } But this does not seem to set the custcol_radid field. Any ideas on how to solve this issue?
0