Purpose

This script supports tax code review for Sales Return 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 typeRESTlet
Deployed toSales Return
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.1
 * @NScriptType RESTlet
 * @author Rina Shah
 */
define(["N/record", "N/search", "N/log"], function (record, search, log) {
  function taxCodeReview(context) {
    var recordType = "salesreturn"
    var project = "Forecast Adjustment Review"
    log.audit({ title: project, details: "Demo processing for " + recordType })
    return true
  }
  return { execute: taxCodeReview, beforeSubmit: taxCodeReview, onRequest: taxCodeReview }
})

This object references:

Technical reference

Record identity

ItemValue
Record nameForecast Adjustment Review RESTlet
Script IDcustomscript_demo_tax_code_review_restlet_03
Object typeRESTlet
Source XMLObjects/customscript_demo_tax_code_review_restlet_03.xml

Project assignment

ItemValue
Primary projectForecast Adjustment Review
Record typesSales Return