In my early tests (just using this User Event sample script from https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteFlex/SuiteScript/UserEvents.225.9.html?NS_VER=2010.1.0). See below for the code.
I've deployed this script attached to Service records for View events. Just to try to see something, I've set Status = released, Log Level = Debug, run as admin = Yes.
I get execution log entries when I view the item in question when logged into NetSuite. But I don't see anything when I view the service item in the web store as a regular customer. If that's the intent of User Event scripts, fine. But what I'm wondering about is what kind of script / deployment I need to use to run something after the item is fetched from the database, but before it's displayed to the customer. I'm trying to work out something similar to related items, so I need to fetch some custom records before displaying the page.
Or at least I hope that's what I'm doing!
Thanks in advance. I'm a total script n00b, so may be asking the wrong questions.
Thanks,
Stefan
function beforeLoad(type,form) { var newId = nlapiGetRecordId(); var newType = nlapiGetRecordType(); nlapiLogExecution('DEBUG','<Before Load Script> type:'+type+', RecordType: '+newType+', Id:'+newId); } function beforeSubmit(type) { var newId = nlapiGetRecordId(); var newType = nlapiGetRecordType(); nlapiLogExecution('DEBUG','<Before Submit Script> type:'+type+', RecordType: '+newType+', Id:'+newId); } function afterSubmit(type) { var newId = nlapiGetRecordId(); var newType = nlapiGetRecordType(); nlapiLogExecution('DEBUG','<After Submit Script> type:'+type+', RecordType: '+newType+', Id:'+newId); }