Discussions
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Join us
Server Scripts on Webstore
We're having problems running User Event scripts on webstore orders on a couple of our accounts. The afterSubmit script is below:
function onAfterSubmit()
{
//var record = nlapiGetNewRecord();
nlapiLogExecution('DEBUG', 'script start');
var recType = nlapiGetRecordType();
nlapiLogExecution('DEBUG', 'Rectype', recType);
var recId = nlapiGetRecordId();
nlapiLogExecution('DEBUG', 'RecId', recId);
var record = nlapiLoadRecord(recType, recId);
var isWebstore = record.getFieldValue('webstore');
if(isWebstore == 'T')
{
nlapiLogExecution('DEBUG', 'try block', isWebstore + recId);
}
else
{
nlapiLogExecution('DEBUG', 'try block', 'not a webstore' + recId);
}
}
None of the log execution statements show up when we create an order through our test webstore. Surprisingly, we have none of these troubles with our 3rd account. Is there some feature or preference to set that enables user event scripts to run on webstore orders?