Discussions
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);