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.
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