Anyone have a workflow action script type of templ...
# administration
r
Anyone have a workflow action script type of template?
s
Copy code
/**
 * @NApiVersion 2.x
 * @NScriptType WorkflowActionScript
 * @author 
 */
define([], function () {
    var exports = {};
    /**
    * @description Entry point for the Workflow Action
    * @param context {Object}
    * @param context.newRecord {Record} New record
    * @param context.oldRecord {Record} Old record
    * @return {*} Any value can be returned and utilized in workflow
    * @function onAction
    * @static
    **/
    exports.onAction = function onAction(context) {
        
    }
    return exports;
});
k
oh they've updated 2.x to work on workflow actions? Cool.
r
Thank you @Sandii!
@Sandii do you have any type of script template for triggering a workflow when a record is created? I'm very new to scripting ha
s
For workflow action, you basically create the script and its a new action under the actions menu. So you can build you workflow like normal with the normal entry point(s) (sounds like create), then transition to your email state, then transition where your script takes place or just add it as another action in the state where the email is taking place.
r
Ok Perfect thank you!
s
Generally, I don't as much of a need for workflow action script if a single UserEvent can do everything (it sounds like it can in this case). Since you do not have much experience scripting, it might be simpler to use the workflow action script and let the workflow do the emailing part (or other stuff). But you could certainly do the emailing/setting fields values in just a single UserEvent script and disregard the workflow all together
r
I tried to describe it all the best way possible in NetSuite built in functionality but what I'm actually trying to do is based off my companies bundle for sending SMS/Texts so I'm trying to add onto our bundle which uses workflows. I think the workflow action script will be best if I can get it working. I might send some more questions your way possibly. Thanks for your help!