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.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Check for Primary Sales Rep - Simple script error question
I'm deploying a script that will stop a user from saving a new opportunity without a primary sales rep identified. It seems simple enough but I am getting an error I'm not familiar with.
Script/Deployment Details:
Type: Client
Name: cs_SalesRepCheck
Save Record Function: clientSaveRecord
Deployed: True
Status: Testing
Event Type: Create
Script Code:
function clientSaveRecord(){ var salesrep = nlapiGetFieldValue(salesrep); if (!(salesrep)){ alert("No Primary Sales Rep Identified. Please choose a primary sales rep before saving."); return false; } else { return true; } }The error being returned on save is:
An unexpected error occurred in a script running on this page.
0