Purpose

This script supports order approval workflow for Vendor records. It reads setup fields, applies validation, and updates process status when records meet the configured conditions.

Behavior

  • Reads the current record and related configuration fields.
  • Validates the record against the process rules documented on this page.
  • Updates status, queue, or review fields used by saved searches and workflows.
  • Logs skipped records with enough detail for support review.

Runtime and deployment

AreaSetting
Script typeUser Event Script
Deployed toVendor
StatusReleased
Log levelAudit

Operational notes

  • Review linked fields and searches before changing this script.
  • Test with a small set of records before enabling broad changes.
  • Check execution logs after deployment changes.

CSDocs Script Source

/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 * @author Jordan Lee
 */
define(["N/record", "N/search", "N/log"], function (record, search, log) {
  function orderApprovalWorkflow(context) {
    var recordType = "vendor"
    var project = "Demo Core Utilities"
    log.audit({ title: project, details: "Demo processing for " + recordType })
    return true
  }
  return {
    execute: orderApprovalWorkflow,
    beforeSubmit: orderApprovalWorkflow,
    onRequest: orderApprovalWorkflow,
  }
})

This object references:

  • Demo Core Utilities - connected through the order approval workflow process.
  • vendor - connected through the order approval workflow process.

Technical reference

Record identity

ItemValue
Record nameDemo Core Utilities User Event
Script IDcustomscript_demo_order_approval_workflow_user_event_27
Object typeUser Event Script
Source XMLObjects/customscript_demo_order_approval_workflow_user_event_27.xml

Project assignment

ItemValue
Primary projectDemo Core Utilities
Record typesVendor