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