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 Rep change comparison in afterSubmit script
Hi, what we are trying to do is send an email alert when a lead is reassigned to a different sales rep. The reassigment is done by a marketing employee.
The script works fine when Team Selling is not enabled.
But when we enable Team Selling the script always take the current employee that is making the reassigment as salesrep field.
What can be done to trigger the sales rep reassigment?
Below I attach the scripts that works fine without Team selling enabled.
function checkReassigment(type){
if (type == 'edit'){
var rec = nlapiGetNewRecord();
var sp = rec.getFieldValue('salesrep');
nlapiLogExecution('debug','New Sales Rep',sp);
0