Reprocessing and Utilities
This folder holds the recovery tools: the scripts and utilities that rebuild quantities, costs, ledger balances and debt ages for a database whose numbers are already wrong. They are not maintenance, they are not routine, and none of them is a first response.
Read this before you run anything here
One document behaving oddly is never a reason to rebuild a database. A single document that has no accounting or inventory effect is fixed from the Business Requests screen — find its request, read why it failed, fix the cause, reprocess that one request.
The tools on these pages empty and rebuild whole tables. On a large database a full rebuild runs for days, the system is unusable while it runs, and there is no undo. Before you start any of them: take a backup, agree the downtime with the customer, and stop the application server where the page tells you to.
Where to start, by symptom
| What you are seeing | Go to |
|---|---|
| One document has no ledger entry or no stock effect | Business Requests — not this folder |
| Item balances or costs are wrong across many documents | Reprocessing Quantity, Cost, and Stock Ages |
| Account balances or customer/supplier ageing are wrong | Ledger and Debt Ages Reprocessing |
| You suspect something is wrong but cannot yet name it | Queries to Check for (and Fix) Cost And Qty Problems |
| The problem is inside one module | The module's utilities — inventory, manufacturing, fixed assets or real estate, below |
| A known list of records must be recommitted, deleted, re-replicated or exported | Batch Utilities That Work From a List File |
| Ownership, rental status, employee state, vacation balances, car status or asset values disagree with the documents | Rebuilding Module System Entries |
| Pending approvals show finished or deleted records, or an old summary | Approval Repair Utilities |
| A site is out of step with head office | Replication Utilities |
| Everything is correct but painfully slow | Suggest Indexes for Large Detail Tables |
| The database is bigger than it should be, or support sees a critical error about 255-byte reference columns or origin indexes | Database Size and Index Utilities |
| You know what you need to do but not which utility does it | The Utility Runner |
| A utility is running and you want to see how far it is, or stop it | The Utility Runner |
The order to work in
- Read before you write. Start with the diagnostic queries. They report; they change nothing, and they tell you how wide the problem really is.
- Fix the narrowest thing that explains it. A failed business request, one document, one dimension.
- Rebuild one area — quantities and cost, or the ledger, or one module's tables — only once you know that area is the one at fault.
- A full rebuild is last, with a backup, an agreed window and the server stopped.
If step 1 does not explain the symptom, that is the moment to escalate rather than to widen the blast radius.
The Utility Runner
Utilities run on one page of the application, the Utility Runner. It lists the most used ones in numbered sections, each with a description and a form for its parameters, shows a run's progress and log while it works, lets you stop it, and keeps the result afterwards. Open it from Utilities → Monitoring → Utility Runner or from the last section of utils.html; see The Utility Runner.
Launcher links on these pages
Many tools on these pages are started from a link rather than a menu. Each one is shown as a small form: an input for each of the tool's parameters, the finished link below them, and two buttons beside it — copy, which copies the link exactly as shown, and show server URL (the eye icon), which opens a box where you type the address of the customer's server. The link is rebuilt as you type, and the address you enter is remembered by your browser for every launcher link on the site, so you set it once per server rather than once per page.
Building a launcher link by hand
In the page's markdown source each launcher is a <UtilityLinkBuilder> tag with a className, sometimes a :params list, and on some a :gui="true". The link it shows is always built the same way, so you can write it yourself from the source:
<server address>/utils?util=<className>-<value 1>,<value 2>,<id>=<value>&gui=true- Server address — the customer's ERP address up to and including
/erp, for examplehttp://localhost:8080/erpon the server itself. className— copied exactly as it is in the tag.- Values — a
-, then the values of the:paramslist separated by commas: first every entry that has noid, as its value alone, in the order listed; then every entry that has anid, asid=value. Use thedefaultvalue unless the customer's case needs another one. An empty value is left out, and with no values at all the-is left out too. Everything after that first-reaches the tool unchanged, so a value may contain a-(employee codes such asE001-E002-E003) but never a comma. &gui=true— add it only when the tag carries:gui="true".
Open the link in a browser where you are logged in to that server as an administrator. The tool starts at once and the browser lands on its run in the Utility Runner, which shows its progress and then its answer.
For example, the Recommit From File launcher on Batch Utilities That Work From a List File is written as:
className="com.namasoft.erp.gui.server.RecommitFromFile"
:params="[
{ title: 'Main File', default: 'e:/rc/recommit.txt' },
{ title: 'Done File', default: 'e:/rc/done.txt' },
{ title: 'Errors File', default: 'e:/rc/errors.txt' }
]" :gui = "true"and its link, with the default values, is:
http://localhost:8080/erp/utils?util=com.namasoft.erp.gui.server.RecommitFromFile-e:/rc/recommit.txt,e:/rc/done.txt,e:/rc/errors.txt&gui=trueA parameter with an id such as { title: 'Types To Process File', default: 'e:/rc/toProcessTypes.txt', id:'file' } becomes -file=e:/rc/toProcessTypes.txt, and a launcher with no :params is just <server address>/utils?util=<className>.