Both customers and prospects can log into our Customer Center, once granted access. I have a custom script which checks a particular field on the customer record.
If the visitor is a customer, no errors happen.
If the visitor is a prospect, an error is thrown while fetching their record. The script contains the following and fails at the nlapiLoadRecord:
var ctx = nlapiGetContext(); var last_update_pref = ctx.getSetting('SCRIPT', 'custscript_eula_lastupdated'); var user_id = ctx.getUser(); nlapiLogExecution('AUDIT', 'showEULA start', 'Starting with user_id ' + user_id); var rec = nlapiLoadRecord('customer', ctx.getUser()); // ERROR HERE, NEVER LOGS THE FOLLOWING: nlapiLogExecution('AUDIT', 'showEULA fetch', 'Customer record fetched for customer ' + user_id); In the audit log for the script:The audit messages get up to the line before the nlapiLoadRecord, then fail with the following error:System SSS_AUTHOR_MUST_BE_EMPLOYEE 8/21/2014 4:58 pm [Customer record name here] The author internal id or email must match an employee. As far as I can tell, the SSS_AUTHOR_MUST_BE_EMPLOYEE only applies when sending mail; nothing in this script sends mail. Any ideas?