Generated page. Written from IdaMilk/SuiteScripts at commit 1f253e6 on 2026-07-28. The repository has no README, so everything below is inferred from source — the script headers are unusually good, but business context is inferred. Corrections belong in the repository.
SuiteScripts
What is it?
A flat collection of standalone SuiteScript 2.x customisations deployed into NetSuite. Fourteen JavaScript files and two HTML print templates, grouped loosely by folder, covering invoice creation, inventory counting and reconciliation, and Bill of Lading / Certificate of Analysis printing.
This is not an application — it is a drawer of individual scripts, each deployed separately in NetSuite.
Purpose
These scripts automate work that would otherwise be done by hand in the NetSuite UI: transcribing lot numbers onto invoices, reconciling pallet detail against on-hand inventory, processing scanned bin counts, and producing shipping and quality documents.
The invoicing script's header is explicit about the motive — it stamps lots onto billed lines "like accounting does by hand".
How it Works
There is no shared runtime. Each file is deployed independently in NetSuite and triggered by its own mechanism, which the @NScriptType header declares.
Three broad patterns appear:
Called from outside NetSuite. The Restlets (createInvoiceFromSO.js, Inventory Count/countTrigger.js, Inventory Count/countCheckStatus.js) are entry points invoked by the SunApps platform. countTrigger accepts a bin ID and a list of scanned pallet IDs, schedules the Map/Reduce job, and returns a task ID; countCheckStatus then polls that task ID for PENDING / PROCESSING / COMPLETE / FAILED. That split exists because Map/Reduce is asynchronous — the caller cannot block on it.
Bulk record processing. The Map/Reduce scripts do the heavy work. Inventory Sync/palletSync.js sums available pallet-detail quantities per item and lot, compares the total to NetSuite's on-hand figure, and posts a single Inventory Adjustment for any delta. inventoryBinReset.js strips bin associations from lot-numbered items through a deliberate four-step sequence — enable bins, zero the lots out of them, disable bins, restore the lots without bin context — and logs distinct failure states (STEP1_FAILED, STEP2_FAILED, STEP3_FAILED) at each stage so a half-finished run can be recovered manually.
Print buttons. BoL and CoA printing each use the same three-part pattern: a User Event script (printBoLButton.js) adds a button to the record's view form and attaches a Client Script; the Client Script (printBoLExpose.js) resolves the Suitelet URL and opens it in a new tab; the Suitelet (printBoLSuitelet.js) gathers the data and renders the HTML template.
Core Features
| Feature | Purpose |
|---|---|
| Invoice from Sales Order | Transforms an SO to an invoice, stamping exact lots and quantities from verified pallet details onto each billed line |
| Bin inventory count | Processes scanned pallets against a bin and posts the resulting adjustment |
| Pallet sync | Reconciles pallet detail quantities against NetSuite on-hand and adjusts the difference |
| Bin reset | Removes bin associations from lot-numbered items, with staged recovery points |
| Inventory consolidation | Moves on-hand inventory between subsidiaries via Intercompany Transfer Orders |
| Bill of Lading printing | Adds a Print BOL button that renders a BoL from an HTML template |
| Certificate of Analysis printing | Adds a Generate COA button that renders quality results from an HTML template |
Script inventory
| File | Script type | Trigger |
|---|---|---|
createInvoiceFromSO.js | Restlet | Called externally |
Inventory Count/countTrigger.js | Restlet | Called externally |
Inventory Count/countCheckStatus.js | Restlet | Called externally (polling) |
Inventory Count/countMapReduce.js | MapReduceScript | Scheduled by countTrigger |
Inventory Sync/palletSync.js | MapReduceScript | Not determinable from source |
inventoryBinReset.js | MapReduceScript | Not determinable from source |
inventoryConsolidationMR.js | MapReduceScript | Not determinable from source |
inventoryTransferTest2.js | ScheduledScript | Manual — test script |
Print BoL/printBoLButton.js | UserEventScript | beforeLoad on view |
Print BoL/printBoLExpose.js | ClientScript | Button click |
Print BoL/printBoLSuitelet.js | Suitelet | GET from client script |
Print CoA/printCoAButton.js | UserEventScript | beforeLoad on view |
Print CoA/printCoAExpose.js | ClientScript | Button click |
Print CoA/printCoASuitelet.js | Suitelet | GET from client script |
Deployment records are not in this repository, so the NetSuite deployment ID and schedule for each script cannot be confirmed here.
Known deployment identifiers
Only two script IDs are hardcoded in source:
| Script | Script ID | Deployment ID |
|---|---|---|
| BoL Suitelet | customscript5304 | customdeploy1 |
| CoA Suitelet | customscript5763 | customdeploy1 |
Configuration constants
Several Map/Reduce scripts carry hardcoded NetSuite internal IDs at the top of the file rather than script parameters:
| Constant | Value | Appears in |
|---|---|---|
LOCATION_ID | 23 | palletSync.js, inventoryBinReset.js |
SUBSIDIARY_ID | 2 | palletSync.js, inventoryBinReset.js |
ADJUSTMENT_ACCOUNT_ID | 476 | palletSync.js, inventoryBinReset.js |
INVENTORY_STATUS_ID | 1 ("Good") | palletSync.js |
ACTIVE_STATUSES | [1, 3, 4, 12] | palletSync.js |
countMapReduce.js is the exception — it reads custscript_inventory_count_bin_id and custscript_inventory_count_pallets as script parameters.
Caveats worth knowing
These are visible in source and worth flagging before anyone runs something unexpected:
inventoryConsolidationMR.jsships withTEST_MODE = trueandTEST_ITEM_ID = 4550. As committed it processes one item, not all inventory. Its header says to flip the flag "before going full".inventoryTransferTest2.jsis a test script with a transfer order ID (4697590) hardcoded in the body.- The print button scripts reference a path that looks like a leftover. Both
printBoLButton.jsandprintCoAButton.jssetclientScriptModulePathtoSuiteScripts/Foster/...and carry the comment<-- your actual path. If a print button ever fails silently, this is the first thing to check. palletSync.js's header asks you to verify thatACTIVE_STATUSESmatches the current pallet status internal IDs and thatADJUSTMENT_ACCOUNT_IDis right, before deploying.
Tech Stack
| Technology | Version | Purpose |
|---|---|---|
| SuiteScript | 2.1 (2.x on older files) | NetSuite server-side scripting |
N/record | — | Record create, load, transform |
N/search | — | Saved and ad-hoc searches |
N/query | — | SuiteQL from Suitelets |
N/task | — | Scheduling Map/Reduce jobs |
N/render | — | HTML template rendering for BoL and CoA |
There is no package.json, no build step and no test suite. Files are deployed to the NetSuite File Cabinet as-is.
Interfaces
| System | Direction | Purpose |
|---|---|---|
| SunApps Gateway | inbound | Calls the Restlets for counts and invoicing |
| NetSuite records | both | Invoices, Item Fulfillments, Inventory Adjustments, Transfer Orders |
Operations
There is no CI in this repository and no deployment automation. Scripts are placed in the NetSuite File Cabinet and script/deployment records are created in NetSuite by hand.
The consequence worth understanding: this repository is a copy, not the source of truth. Nothing verifies that a file here matches what is deployed in the account. Suntado_SDF is the repository that uses SuiteCloud Development Framework for managed deployment.
Failures surface in NetSuite's script execution logs. The Map/Reduce scripts log deliberately — inventoryBinReset.js in particular logs lot data at each failure stage specifically so a partial run can be reversed by hand.
Repository
| Repository | IdaMilk/SuiteScripts |
| Primary language | JavaScript (SuiteScript 2.x) |
| Files | 17 |
| Last activity | 2026-07-22 |
| Status | Active |
| README | None |