Can anyone help me get a scheduled workflow action...
# general
m
Can anyone help me get a scheduled workflow action script working? The script runs when the workflow is event based and the action trigger on is set to view. It does not run when the workflow is scheduled and the action trigger is set to scheduled. Any tips? Here is the test script. Just logging the record id.
Copy code
/**
 * @NApiVersion 2.x
 * @NScriptType WorkflowActionScript
 */
define(['N/log'], function (log) {
  function onAction(scriptContext) {
    var record = scriptContext.newRecord;
    var id = record.getValue("id");
    log.debug({
      title: "Action",
      details: "Running script on record id ".concat(id)
    });
  }
  return {
    onAction: onAction
  };
});