We have an employee that recently changed their na...
# suitescript
n
We have an employee that recently changed their name. Why would the following script produce an error if their email was correct at the time the script ran?
Copy code
if (parentData && parentData.salesRep) {
                salesRep = parentData.salesRep;
            // Check to see if salesRep exists and was found in dataCache.employees object
            } else if (repEmail && dataCache.employees[repEmail]) {
                salesRep = dataCache.employees[repEmail];
            } else {
                validationFailed = true;
                errorArr.push('Sales Rep Email is missing or is invalid, cannot proceed');
c
The code alone doesn't tell me much. Step through this in the debugger and look at the variable values (or use print statements).
1