Purpose

This script supports order change audit for Cash Sale 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 typeSuitelet
Deployed toCash Sale
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 Suitelet
 * @author Alex Morgan
 */
define(["N/record", "N/search", "N/log"], function (record, search, log) {
  function orderChangeAudit(context) {
    var recordType = "cashsale"
    var project = "Item Fulfillment Controls"
    log.audit({ title: project, details: "Demo processing for " + recordType })
    return true
  }
  return { execute: orderChangeAudit, beforeSubmit: orderChangeAudit, onRequest: orderChangeAudit }
})

This object references:

Technical reference

Record identity

ItemValue
Record nameItem Fulfillment Controls Suitelet
Script IDcustomscript_demo_order_change_audit_suitelet_15
Object typeSuitelet
Source XMLObjects/customscript_demo_order_change_audit_suitelet_15.xml

Project assignment

ItemValue
Primary projectItem Fulfillment Controls
Record typesCash Sale