Purpose

This script supports commission eligibility flags for Account 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 typeWorkflow Action Script
Deployed toAccount
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 WorkflowActionScript
 * @author Sam Okafor
 */
define(["N/record", "N/search", "N/log"], function (record, search, log) {
  function commissionEligibilityFlags(context) {
    var recordType = "account"
    var project = "Item Margin Guardrails"
    log.audit({ title: project, details: "Demo processing for " + recordType })
    return true
  }
  return {
    execute: commissionEligibilityFlags,
    beforeSubmit: commissionEligibilityFlags,
    onRequest: commissionEligibilityFlags,
  }
})

This object references:

  • Item Margin Guardrails - connected through the commission eligibility flags process.
  • account - connected through the commission eligibility flags process.

Technical reference

Record identity

ItemValue
Record nameItem Margin Guardrails Workflow Action
Script IDcustomscript_demo_commission_eligibility_flags_workflow_action_09
Object typeWorkflow Action Script
Source XMLObjects/customscript_demo_commission_eligibility_flags_workflow_action_09.xml

Project assignment

ItemValue
Primary projectItem Margin Guardrails
Record typesAccount