Data Patcher
NetSuite admins have a powerful system at their fingertips. But as soon as the word “script” enters the conversation, many feel handcuffed: “I guess I need to pass this to a developer.”
We are releasing Data Patcher, a free utility in the Topaz Harbor Admin Utilities lineup, to make that happen less often.
This page shows the pattern: use custom records and SuiteQL to build solutions that go well beyond basic admin configuration, including complex workflows like commission calculations.
There is still real technical work involved. But if you are comfortable designing custom records and writing SuiteQL, Data Patcher gives you a practical way to execute those solutions inside NetSuite.
Start Here
Who This Is For
This is built for NetSuite admins who face difficult requests, such as:
- Set a “Status Last Changed” date field based on system notes
- Default “Status” to “Not Started” on any cases where status is blank
- Calculate commission earned based on custom commission plan records
If your job is “make this process work in NetSuite” and the rules are more complex than saved searches and simple workflows, Data Patcher can often help you ship a practical solution faster.
What Data Patcher Actually Does
- Runs scheduled Map/Reduce jobs from a SuiteQL query.
- Updates body fields on existing records.
- Updates sublist line fields using
lineuniquekey. - Optionally creates records from query results.
- Optionally deletes records from query results.
- Supports dry runs before writing any changes.
- Supports capped runs (
Max Rows) for staged rollout and risk control.
The Paradigm (Not Just a Script)
While Data Patcher can be used for single-field data calculations, it’s true power shines with with this pattern:
- Define the business rules in custom records (or existing NetSuite records).
- Create the fields or custom records where you’ll store the data.
- Use SuiteQL to produce the exact rows/actions you need.
- Run one or more Data Patcher deployments to apply the results safely.
Example Pattern: Commissions Without a Big Custom Build
A strong example is commission calculations with many plan variations.
Using a tool like Data Patcher, a client with 14 different commission plans was able to eliminate their subscription to the NetSuite commissions module (which wasn’t working for them). Here’s how they did it:
- Create custom records to define the commission plans and rules.
- Create custom records to store commission earned per transaction line (
Sales Order,Invoice,Credit Memo, etc.). - Run a small set of Data Patcher deployments that calculate and write the earned commission records based on plan rules and transaction data.
- Build saved searches based on those custom records for review and payout.
This is the point of the tool: admins can build powerful solutions by combining good data modeling with repeatable query-driven execution.
Safe Admin Rollout Workflow (How to Get Started)
To validate everything is setup properly, create a deployment and plugin a basic query. You can trigger the script to execute by saving the deployment and then clicking edit and “Save and Execute” on the script deployment.
With the “Dry Run” checkbox checked, you should see logs only that show what records would be updated.
- Build and test the SuiteQL query so the result rows are exactly what you expect.
- Use a tool like Tim Dietrich’s SuiteQL Tool to write your queries
- Create a deployment for that specific job (one deployment per use case).
- Run with
Dry Run = true. - Review logs and validate records.
- Set
Max Rowsfor staged rollout if risk is high. - Run with
Dry Run = false. - Schedule recurring runs only after the job is validated.
Use a basic query like this to get started:
SELECT TOP 10
id AS recordid,
recordtype,
'test' AS fieldid_custbody_mytestmemo
FROM transaction
WHERE recordtype = 'salesorder'
Install and Setup (Self-Serve)
1) Admin Install Path (No SDF)
Best for NetSuite admins who are not using SDF:
- Download the current file from GitHub
- Upload the script file to File Cabinet.
- Create the script record and setup parameters (see parameters section below)
Parameters
You must configure these parameters with these exact IDs and Types for the script to execute as expected.
| Title | ID | Type | Default Value |
|---|---|---|---|
| SuiteQL | _th_dp_suiteql | Long Text | (blank) |
| Force Load + Save Mode | _th_dp_force_loadsave | Check Box | unchecked |
| Dry Run | _th_dp_dry_run | Check Box | checked |
| Stop On Error | _th_dp_stop_on_error | Check Box | unchecked |
| Max Rows | _th_dp_max_rows | Free-Form Text | 0 |
| Alias Prefix | _th_dp_alias_prefix | Free-Form Text | fieldid_ |
| Query Custom Script ID (Advanced) | _th_dp_custom_script_id | Free-Form Text | th_data_patcher |
| Enable Create/Delete Actions | _th_dp_enable_actions | Check Box | unchecked |
2) Developer Install Path (SDF)
Best for technical teams using SuiteCloud CLI:
- Clone the repo and move into
Data Patcher/. - Run
suitecloud project:validate. - Run
suitecloud project:deploy. - Verify script and deployment IDs in the target account.
Documentation
Detailed install, admin operations, and use-case documentation:
Technical Appendix: AI-Generated SuiteQL (Optional)
If you use AI to draft SuiteQL, treat it as a starting point, not the source of truth.
Recommended admin workflow:
- Generate a first draft query.
- Validate aliases and required columns (
recordtype,recordid,fieldid_*, etc.). - Review filters, joins, and ordering carefully.
- Run a small dry run before any real execution.
Data Patcher is the controlled execution layer. Human review and rollout discipline still matter.
Ready to Use It?
If you need help designing the data model, writing the SuiteQL, or structuring the deployment jobs, we can help with that too.