Reputation: 1341
We have a user event script attached to a sales order in NetSuite, however we are noticing that only the context.UserEventType.CREATE is being called. EDIT, COPY and the others DO NOT catch the sales order manipulations as per spec. Can anyone please verify this. Ive attached a very simple UserEvent script that should throw the context type but it is not working.
This UserEvent script is for a salesorder record:
/**
*@NApiVersion 2.x
*@NScriptType UserEventScript
*/
define(["N/record", "N/search"],
function (record, search) {
function beforeSubmit(context) {
throw "beforeSubmit:" + context.type;
}
function afterSubmit(context) {
throw "afterSubmit:" + context.type;
}
function beforeLoad(context) {
throw "beforeLoad:" + context.type;
}
return {
beforeLoad: beforeLoad,
beforeSubmit: beforeSubmit,
afterSubmit: afterSubmit
};
});
Upvotes: 2
Views: 2193
Reputation: 3029
The code looks good. Check the deployment and see if the event type is set to create only.
Upvotes: 7