Purpose

This script supports renewal opportunity routing for Assembly Item 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 typeScheduled Script
Deployed toAssembly Item
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 ScheduledScript
 * @author Leo Brooks
 */
define(["N/record", "N/search", "N/log"], function (record, search, log) {
  function renewalOpportunityRouting(context) {
    var recordType = "assemblyitem"
    var project = "Customer Deposit Matching"
    log.audit({ title: project, details: "Demo processing for " + recordType })
    return true
  }
  return {
    execute: renewalOpportunityRouting,
    beforeSubmit: renewalOpportunityRouting,
    onRequest: renewalOpportunityRouting,
  }
})

This object references:

Technical reference

Record identity

ItemValue
Record nameCustomer Deposit Matching Scheduled
Script IDcustomscript_demo_renewal_opportunity_routing_scheduled_07
Object typeScheduled Script
Source XMLObjects/customscript_demo_renewal_opportunity_routing_scheduled_07.xml

Project assignment

ItemValue
Primary projectCustomer Deposit Matching
Record typesAssembly Item