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.
Simple script that pulls the original sales order number to a custom field on a copied sales order
I was following SuiteAnswers: Answer Id: 44790, but am obviously missing something. I will first note that I am working in our Sandbox and have no experience with scripting. I am hoping this would be an easy answer for someone in this forum.
1. I started by creating a custom transaction body field on our Sales Order form. Field ID: 'custbody_dlw_originating_record'
2. Create a Client Script with a pageInit function using the sample code below
3. The script looks like this:
function getSourceID(type){
if (type = 'copy'){
var entryForm = nlapiGetFieldValue('entryformquerystring');
if (entryForm.charAt(0) == 'r'){
var entryForm_substr = entryForm.substr(8);
var start_pos = entryForm_substr.indexOf("=");