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.
Help set a default value for Department
Hello,
I spoke with Netsuite support about setting a default value for the "department" field on a custom form. They advised that I could run the following script as a User Event Script.
I don't know how to script or set this up.
Outcome:
Set department on a sales order to a default value: department field = icandy Creative
Code Provided by Support:
*** START CODE ***
var customForm = nlapiGetFieldValue('customform');
if(customForm == 100) // You may simply replace '100' with the internal ID of your custom form.
{
....place your code here....
}
*** END CODE ***
My Code:
// *** START CODE ***
var customForm = nlapiGetFieldValue('customform');
if(customForm == 117) // You may simply replace '100' with the internal ID of your custom form.