1
votes

Have a UserEvent SuiteScript 2.0 which is only firing when the create Support Case is performed in the UI and not when the case is created via Email submission.

/**
 * Support Case Users Scripts
 *
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 * @ModuleScope SameAccount
 *
 */
define(["N/log"], function (log) {
    var exports = {};
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    function beforeSubmit(context) {
        log.debug('before submitting', 'in');
    }
    exports.beforeSubmit = beforeSubmit;
    return exports;
});

Have tried beforeLoad & afterSubmit as well, in addition ModuleScope tried Public. Script deployment has all 27 context selected. I see my log in all cases when via the UI. Was also having trouble with getting a workflow to fire during the same event. I have a script which does fire using SuiteScript 1 just fine and so I could extend this one, though I'd prefer to continue working in 2.0.

1
A common reason is forgetting Status: Testing on a deployment means it only runs for you and the specified audience as long as you are a member of that audience type.Brian
Thanks, that was totally it! Knew it was likely something simple.Joshua Fricke

1 Answers

2
votes

When submitting a Support Case via Email, Script Deployment Status needs to be set to Released for the script to trigger.