Blog · Performance
Why is saving a Sales Order in NetSuite so slow?
When a NetSuite user says “Sales Orders take forever to save,” the cause is almost never NetSuite itself. On a mature account, a single click of Save can trigger a dozen User Event scripts, three Workflows, and a handful of synchronous lookups before the page reloads.
Here is the exact sequence I use to isolate what is actually slowing down a Sales Order save.
Step 1: Split server time from client time in APM
Start in Customization › Performance › Application Performance Management › Record Pages Monitor and filter to Sales Order and the Save operation.
- Client / Network time high: Look at Client Scripts running on
saveRecordorvalidateLine—especially any script callingsearch.lookupFieldsor a Suitelet synchronously before allowing the save. - SuiteScript / Workflow time high: The bottleneck is server-side in
beforeSubmit,afterSubmit, or Workflow actions running on Create/Edit.
APM tells you which script took the seconds, which narrows the hunt immediately—but it won’t show you how that script interacts with the other scripts deployed on the same record.
Step 2: Check the full stack on Scripted Records
Open Customization › Scripting › Scripted Records and view Sales Order. Check both the Scripts tab and the Workflows tab.
Pay attention to the execution order. Over years of consultants and projects, accounts accumulate stacked beforeSubmit and afterSubmit scripts that each re-read the same customer, item, or line values independently. Even if no single script looks terrible on its own, eight of them running in series add up fast.
Step 3: Look for the four SuiteScript patterns that stall saves
Once you open the slowest script from APM, nine times out of ten you will find one of these four patterns:
- Queries inside a line-item loop: Calling
search.create()orsearch.lookupFields()once per Sales Order line. On a 40-line order, that turns one save into 40 separate database round-trips. Batch the item IDs into a single search using ananyoffilter before the loop. - Loading and re-saving the same record in
afterSubmit: Callingrecord.load()andrecord.save()on the Sales Order inside its ownafterSubmitdoubles the save cost and can re-trigger Workflows. UsebeforeSubmitto set header/line values oncontext.newRecord, orrecord.submitFields()when you only need to update a few body fields. - Synchronous external HTTP calls during save: Calling
https.post()to a tax engine, 3PL, or CRM insidebeforeSubmitorafterSubmitmakes the user wait on an outside API. Offload non-blocking syncs to a Map/Reduce or Scheduled Script triggered viaN/task. - Heavy Workflow Saved Search conditions: Workflows set to run on Before Record Submit or After Record Submit that evaluate complex Saved Search conditions on every edit, even when the relevant fields didn’t change.
Step 4: Check downstream records triggered by the save
If an afterSubmit script creates or updates an Item Fulfillment, Invoice, or custom record synchronously, that child record’s own User Event scripts and Workflows execute inside the same Sales Order save window. Fixing the Sales Order often means tracing one level deeper into the records it touches.
Where CSDocs helps
CSDocs maps the complete execution chain on every record type—every Client Script, User Event, and Workflow in order—and flags slow scripts and stacked deployments automatically every night. You can open Sales Order inside NetSuite, see what runs on Save, and ask in plain English which scripts touch a field or trigger another record before you refactor anything.
More NetSuite guides
How to fix SSS_USAGE_LIMIT_EXCEEDED in SuiteScript
Governance limits by script type, the four patterns that burn units fastest, and how to refactor them safely.
CleanupHow to audit an inherited NetSuite account
A five-step checklist for taking over a heavily customized NetSuite account without breaking production.