Ortems Toolbox is a Windows application built with AutoIt to create, review, validate, and import demonstration data into an Ortems SQL Server database.
The tool replaces the older macro-based spreadsheet workflow with a tabbed interface for maintaining calendars, machines, operations, routings, items, BOMs, work orders, secondary resources, capacity data, and inventory movements. Once the data is prepared, the application generates a structured SQL script and can execute it directly against the connected database.
⚠️ Recommended use: demo, training, sandbox, or cloned environments. Do not run this tool against a production database without a backup, a full review of the generated SQL, and validation from the environment owner.
The Toolbox was designed to speed up the preparation of Ortems databases, especially when a planning scenario needs to be created quickly for a demo, training session, proof of concept, or functional validation.
Main goals:
- reduce dependency on Excel macro workbooks;
- make Ortems demo data easier to create and maintain;
- validate references before importing data;
- generate traceable SQL scripts;
- support Excel workbook import/export for round-trip editing;
- keep Work Orders in a launchable state, without pre-creating WIP/launch records.
- Connects to an Ortems SQL Server database.
- Supports:
- Windows Authentication;
- SQL Server Authentication.
- Displays the active connection string.
- Tests the connection using
ADODB.Connection. - Includes an Inspect Table utility to view Ortems table columns and troubleshoot schema differences.
The Modules tab defines the functional scope of the scenario:
- PS - Production Scheduling or MP - Master Planning;
- SRP;
- WO Links;
- Complex Routings;
- Secondary Resources;
- Batch Machines;
- Inventory;
- Markers;
- Limited Resources;
- Parameters.
Tabs are enabled or locked automatically based on the selected modules.
Each data tab includes actions to:
- add a row;
- edit the selected row;
- delete the selected row;
- delete all rows from the tab;
- import CSV;
- export CSV;
- load sample data.
Main tabs:
| Tab | Purpose | Main Ortems tables involved |
|---|---|---|
| Calendars | Calendars and working periods | B_CAL, B_PERI |
| Machines | Sites, work centers, sections, and machines | B_ZONE, B_ILOT, B_SECT, B_MACH |
| Operations | Operations and machine rates | B_OPE, B_CADE |
| Routings | Routings and phases | B_GAMM, B_PHAS |
| Items | Items, item versions, and production routings | B_ART, B_VER_ART, E_GAMME_NOME when applicable |
| BOM | Product structure | B_NOME |
| Work Orders | Planned/launchable production orders | B_OF |
| WO Links | Precedence relationships between WOs/operations | B_PROF, when applicable after launching |
| Secondary Resources | Secondary resources by operation | Resource-related auxiliary tables, depending on the schema |
| Capacity | Capacity calendars | Capacity-related tables, depending on the schema |
| Inventory Movements | Inventory transactions | Inventory-related tables, depending on the schema |
The application can export a structured workbook with all data tabs and import that same workbook back into the tool.
Important rules:
- do not rename the generated sheets;
- do not change the headers;
- data is treated as text to prevent Excel from automatically converting dates and times;
- the
Linecolumn is regenerated by the application during import.
The exported workbook includes a README sheet with the integrity status at the time of export.
Before generating or executing SQL, the Toolbox performs cross-tab validation. Examples include:
- operations pointing to existing work centers and machines;
- routings pointing to existing operations;
- manufactured items pointing to valid routings;
- BOM rows pointing to valid items, versions, and routings;
- Work Orders pointing to valid items and routings;
- inventory movements pointing to valid items;
- calendar, capacity, and date format checks.
When possible, the app offers simple automatic fixes, such as reference normalization when the only issue is case, extra spaces, or a single obvious match.
The Generate & Run SQL tab allows you to:
- generate the full SQL script;
- review the script before execution;
- execute it on the connected database;
- save the script as a
.sqlfile; - review the execution log.
By default, SQL execution runs inside a transaction. If an error occurs, the app attempts to roll back the transaction to avoid leaving the database partially loaded.
The current version imports Work Orders as launchable orders by creating records in B_OF.
It does not pre-create records in E_OF or B_BT.
This is intentional.
In Ortems, E_OF and B_BT belong to the launch/WIP side of the model and should be created by Ortems through the native Launching process. When those records are created manually during import, Ortems may interpret the WO as already existing in WIP and return errors such as:
E_OF_EXISTS
The expected flow is:
- import data through the Toolbox;
- open Ortems;
- review the Work Orders;
- launch the Work Orders using the native Ortems launching process.
Links between Work Orders depend on launched operational lines, usually associated with B_BT/B_PROF, depending on the Ortems version and schema.
Because the Toolbox keeps WOs in a launchable state, WO Links are skipped during the import of non-launched WOs. If the scenario requires operation-level links, create or update those links after Ortems has launched the WOs and generated the corresponding operational lines.
The current version forces a global clean import mode to avoid old residual data in demo databases.
During SQL generation, the application:
- disables constraints on all user tables;
- checks whether any foreign key remains enabled;
- disables triggers;
- deletes data from all non-system user tables;
- validates that the tables are empty;
- recreates the scenario data;
- recreates reference data required by Work Orders, such as the default series and WIP/en-cours reference;
- re-enables triggers;
- revalidates constraints.
⚠️ This process is destructive. It was designed for demo/sandbox databases. Always create a backup before running it.
- Windows 10 or later.
- Access to an Ortems SQL Server database.
- SQL Server ODBC/OLE DB provider available on the machine.
- Sufficient database permissions to:
- connect;
- insert/update/delete data;
- disable/re-enable constraints and triggers when clean import is used.
- Microsoft Excel installed, only if workbook import/export is required.
- AutoIt 3.
- SciTE4AutoIt3 or AutoIt3Wrapper.
- x64 compilation enabled.
- Project support files stored in the same folder as the source code.
.\Toolbox
├── Toolbox.au3
├── Updater_lib2.au3
├── Toolbox.ico
├── splash.jpg
├── Help.html
├── Updater.exe
├── FileUpdate.exe
├── README.md
└── .gitignore
Runtime-generated files, such as settings.ini, logs, exported workbooks, and generated SQL files, should not be committed.
-
Clone or copy the project to a local folder:
.\Toolbox -
Open
Toolbox.au3in SciTE/AutoIt. -
Make sure all support files are in the same folder:
.\Updater_lib2.au3 .\Toolbox.ico .\splash.jpg .\Help.html .\Updater.exe .\FileUpdate.exe -
Before publishing or compiling for distribution, use relative paths in the AutoIt3Wrapper directives. Example:
#AutoIt3Wrapper_Res_File_Add=.\Updater.exe #AutoIt3Wrapper_Res_File_Add=.\Help.html #AutoIt3Wrapper_Run_After=.\FileUpdate.exe
-
Compile as x64.
-
Create a release containing the final executable and, if required by the project update model, the updater support files.
- Open the Toolbox.
- On the Database tab, enter:
- Server / Instance;
- Database name;
- authentication type.
- Click DB Connect.
- Confirm that the status changed to connected.
- Go to the Modules tab.
- Select PS or MP.
- Enable the modules required for the scenario.
- Click Apply / Show Summary if you want to review the selected scope.
Fill the tabs in the logical order:
- Calendars;
- Machines;
- Operations;
- Routings;
- Items;
- BOM;
- Work Orders;
- optional modules, when applicable.
You can also use Load Example to create a starter dataset and then adjust it to your scenario.
Click Integrity Check.
Fix the reported issues before generating SQL. When the app offers an auto-fix, review the result before continuing.
Click Generate SQL.
Review the script in the Generate & Run SQL tab. This step matters because the script may delete and recreate data in the connected database.
Click Run on DB.
Confirm execution only after verifying that the connected database is the correct one and that a backup or rebuild option is available.
After successful execution:
- open Ortems;
- verify the imported data;
- launch the Work Orders using the native Ortems process.
The application automatically creates a settings.ini file in the same folder as the executable/source code.
Example:
[Connection]
Server=localhost\SQLEXPRESS
Database=ORTEMS_DEMO
Auth=Windows Authentication
User=
[Modules]
Mode=PS
SRP=0
WOL=0
SR=0
INV=0
MRK=0
LR=0
PRM=0
BATCH=0
CROUT=0
[SQL]
ClearFirst=1
Transaction=1
Verbose=0
[Logging]
VerboseMode=0
[Window]
X=-1
Y=-1
W=1100
H=720Notes:
- this file is local to each machine/user;
- do not publish this file to GitHub;
- passwords must not be committed;
- for troubleshooting, enable
VerboseMode=1or turn on Verbose Mode in the interface.
Logs are written to:
.\log
Use Verbose Mode when investigating:
- connection errors;
- missing columns in Ortems tables;
- foreign key errors;
- transaction rollbacks;
- SQL generation issues;
- clean import failures.
Verbose mode records additional details, including schema detection queries and executed commands.
This error usually means that the database already contains launch/WIP records related to the same WO.
The current version avoids this issue by design:
- it creates the WO in
B_OF; - it does not create
E_OF; - it does not create
B_BT; - it cleans old residual data during clean import.
If the error still occurs, confirm that:
- you are using the current version of the application;
- the SQL was regenerated after the update;
- the import completed successfully;
- no external customization is recreating
E_OForB_BTbefore Ortems launching; - the log does not show a clean import failure or transaction rollback.
Check whether:
- all tabs passed Integrity Check;
- IDs are written exactly as expected;
- the Ortems version/schema uses different column names;
- the verbose log shows any column that could not be detected;
- the database has specific triggers or customizations.
Workbook import/export uses Microsoft Excel COM automation. Excel must be installed on the Windows machine running the application.
- Always use a cloned or demo database.
- Create a backup before running Run on DB.
- Generate and review the SQL before executing it.
- Keep IDs simple, stable, and free from unnecessary special characters.
- Enter data in the logical order: calendar → machine → operation → routing → item → BOM → WO.
- Run Integrity Check before any database execution.
- Enable Verbose Mode before reproducing an error.
- Do not commit
settings.ini, logs, customer workbooks, or exports containing sensitive data.
# Runtime settings
settings.ini
# Logs
log/
*.log
# Build output
*.exe
*.a3x
*.bak
# Local exports/imports
*.xlsx
*.xlsm
*.csv
*.sql
# Editor/OS files
.vscode/
.idea/
.DS_Store
Thumbs.dbIf you want to publish binaries through GitHub Releases, keep
.exefiles out of the main repository and attach them to the release instead.
Before publishing this project:
- remove absolute paths from your machine;
- use only relative paths, such as
.\Toolbox; - do not publish
settings.ini; - do not publish real customer logs;
- do not publish Excel/CSV/SQL exports containing sensitive data;
- review executable metadata before distribution;
- validate that the updater does not contain tokens, private URLs, or credentials.
- Windows-only application.
- Requires SQL Server and an available ODBC/OLE DB provider.
- Excel import/export requires Microsoft Excel to be installed.
- The Ortems schema may vary across versions. The app attempts to detect columns dynamically, but heavily customized schemas may require code adjustments.
- Operation-level WO Links are not applied during the import of launchable WOs. They should be handled after Ortems creates the launch lines.
- Clean import is destructive and should not be used in production.
Possible future improvements:
- non-destructive mode for partial refreshes;
- dedicated Ortems schema diagnostics screen;
- HTML integrity report;
- JSON import/export in addition to Excel/CSV;
- fuller support for post-launch WO Links;
- database impact preview before Run on DB;
- automated tests for SQL generation by module.
Define the license before publishing the project.
Suggested action: add a LICENSE file to the repository root and update this section with the selected license name.
This project directly manipulates Ortems SQL Server database tables. Use it carefully, always in a controlled environment, and review the generated SQL before execution.