Purpose

This script supports shipping exception alerts for Lead 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 toLead
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 1.0
 * @NScriptType UserEventScript
 * @author Casey Rivera
 */
define(["N/record", "N/search", "N/log"], function (record, search, log) {
  function shippingExceptionAlerts(context) {
    var recordType = "lead"
    var project = "Customer Credit Recheck"
    log.audit({ title: project, details: "Demo processing for " + recordType })
    return true
  }
  return {
    execute: shippingExceptionAlerts,
    beforeSubmit: shippingExceptionAlerts,
    onRequest: shippingExceptionAlerts,
  }
})

This object references:

  • Customer Credit Recheck - connected through the shipping exception alerts process.
  • lead - connected through the shipping exception alerts process.

Technical reference

Record identity

ItemValue
Record nameCustomer Credit Recheck User Event
Script IDcustomscript_demo_shipping_exception_alerts_user_event_12
Object typeUser Event Script
Source XMLObjects/customscript_demo_shipping_exception_alerts_user_event_12.xml

Project assignment

ItemValue
Primary projectCustomer Credit Recheck
Record typesLead