Now taking pilot teams: 60 days with the full Pro feature set and a weekly call with the founder. Ask about a place →
Sample Trussmap X-ray: a fictitious NAV estate
This is a complete Migration X-ray (v0) on “Northgate Tools”, a fictitious NAV estate with LIVE, UAT and DEV environments. It shows 6 executive findings on an 18-object estate. Download the PDF (407 KB) (A4, 12 pages).
Sample report on fictitious data. Every object was written for the demo; none of it is Microsoft code or any customer’s code. Every figure comes from a command that was actually run.
| Estate | Northgate Tools (fictitious), estate id northgate |
|---|---|
| Environments | LIVE (PROD), UAT (UAT), DEV (DEV) |
| Primary environment for sections 1, 3, 4, 5 | LIVE |
| Prepared | 24 Oct 2026, with Trussmap tm 0.1.0 (rules: X-ray v0) |
| Input | .txt object exports, read inside the customer’s network. Only this report leaves. |
| Tier used | Community (no licence file). LIVE is the configured environment with snapshot history; UAT and DEV were read as stand-alone indexes and through tm compare live --folder |
| Not in v0 | Section 2 (modified-standard detail), 6 (BC-readiness), 7 (effort banding) |
Sample limitation: the demo exports hold custom objects only. A real X-ray uses a full export of every object, so section 1 would also count standard objects (untouched and modified), and standard object names would come from the export itself. Here, names of standard objects that are not spelled out in the custom code were added by hand; they are marked with *. The build says so itself: “the export holds custom objects only (no ID below 50000): 3 reference(s) by name to objects outside it are not resolved”.
Executive summary
- LIVE holds a fix that test does not. Codeunit 50130 Label Print Mgt was changed in LIVE (WMS1.00 → WMS1.01, file server moved) and the change is not in UAT or DEV. The next deployment of this object from UAT would undo it. (Appendix A, D1)
- The price import talks straight to another SQL Server, and the server name is in the code. Codeunit 50140 opens a
SqlConnectiontoPRICESRV01. The UAT copy has the same Version List but points toPRICESRV-UAT; deploying the UAT copy would point LIVE at the test price server. (Section 4; Appendix A, D4) - Custom code reaches into 10 standard objects (8 tables, 2 codeunits). It writes to two standard tables (Item, Sales Price, including a sister company via
CHANGECOMPANY), posts to the G/L through Codeunit 12, and subscribes twice to Codeunit 80’sOnAfterPostSalesDoc. These are the places to retest first in a Business Central move. (Section 3) - 5 DotNet/Automation variables in 3 objects, including an Excel Automation object and
System.IO.File. None of these run unchanged in Business Central SaaS (from general Business Central platform knowledge; not tested on this estate). (Section 4) - 2 COMMITs inside loops (price import and nightly price update): partial updates are possible if a run fails midway. (Section 4)
- 4 objects have no inbound reference; 1 is a clear leftover (Codeunit 50115, Version List COM0.90, date stamp 14/03/19). 1 public procedure is never called. All are candidates to confirm, not to delete. (Section 5)
1. Estate summary (LIVE)
Objects and lines by type
| Type | Objects | Lines |
|---|---|---|
| Codeunit | 9 | 424 |
| Page | 3 | 115 |
| Report | 2 | 92 |
| Table | 4 | 134 |
| Total | 18 | 765 (sum) |
Source: tm stats; tm sql "SELECT obj_type, COUNT(*), SUM(n_lines) … GROUP BY obj_type". Lines are stored source lines with RDLC layout removed.
Custom vs standard (ID band)
| Band | Objects |
|---|---|
| Custom (50,000–99,999) | 18 |
| Standard range | 0 (not in the sample export) |
| Add-on range | 0 |
Source: tm sql "SELECT CASE WHEN obj_id BETWEEN 50000 AND 99999 … END AS band, COUNT(*) …".
Version List tags
| Tag | Objects | Lines | Area |
|---|---|---|---|
| COM0.90 | 1 | 27 | Commission (old) |
| COM1.00 | 8 | 344 | Commission |
| CON1.00 | 2 | 86 | Legacy export |
| PRC2.00 | 1 | 33 | Price feed |
| PRC2.03 | 2 | 135 | Price feed |
| WMS1.00 | 3 | 88 | Warehouse labels |
| WMS1.01 | 1 | 52 | Warehouse labels (LIVE hotfix) |
Source: tm sql "SELECT version_list, COUNT(*), SUM(n_lines) … GROUP BY version_list". “Area” is the analyst’s reading of the tag prefix.
Other measures
| Measure | Value | Source |
|---|---|---|
| Procedures (all in codeunits) | 16 | tm stats; tm sql "… FROM procedures GROUP BY obj_type" |
| Fields in custom tables | 17 | tm stats |
Objects flagged Modified=Yes |
4: Codeunits 50110, 50130, 50140; Table 50100 | tm sql "SELECT obj_type, obj_id, modified FROM objects WHERE modified='Yes' …" |
| Oldest date stamp | 17/11/16 (Codeunit 50150, Report 50151) | tm sql "SELECT … date AS date_stamp, modified … FROM objects …" |
| Newest date stamp | 09/10/26 (Codeunit 50130) | same |
| Objects per environment | LIVE 18, UAT 18, DEV 20 | tm stats; tm stats --db idx/uat.db, --db idx/dev.db |
3. Custom dependency map (LIVE)
Standard objects used by custom code
| Standard object | Used by | How | Access |
|---|---|---|---|
| Table 13 Salesperson/Purchaser | Codeunit 50115 CalcCommission; Report 50120; Tables 50100, 50101 |
local variable; DataItem; TableRelation | read (GET); read; relation |
| Table 18 Customer* | Report 50151; Codeunit 50150 ExportCustomerSales |
DataItem; VAR parameter | read; read (FINDSET, CALCFIELDS) |
| Table 27 Item | Codeunit 50140 ImportPrices; Codeunit 50141 OnRun; Table 50142 |
local variable; local variable (trigger); TableRelation | read (GET); write (VALIDATE, MODIFY(TRUE)); relation |
| Table 36 Sales Header* | Codeunit 50111 OnAfterPostSalesDoc; Codeunit 50132 PrintLabelsOnShipment |
event parameter | read (CALCFIELDS); declared, not used |
| Table 81 Gen. Journal Line* | Codeunit 50160 TransferCommission |
local variable | fields set, no INSERT; passed to Codeunit 12 |
| Table 110 Sales Shipment Header* | Codeunit 50130 PrintShipmentLabels, FormatLabelLine |
local variable, parameter | read (GET) |
| Table 111 Sales Shipment Line* | Codeunit 50130 PrintShipmentLabels, FormatLabelLine |
local variable, parameter | read (FINDSET) |
| Table 7002 Sales Price* | Codeunit 50140 UpsertPrice, CopyToSisterCompany; Codeunit 50141 GetBasePrice |
VAR parameter, local variables | write (INSERT, MODIFY, also in company ‘Northgate Tools Ireland Ltd’); read (FINDFIRST) |
| Codeunit 12 Gen. Jnl.-Post Line* | Codeunit 50160 | global variable | call RunWithCheck: posts G/L entries |
| Codeunit 80 Sales-Post* | Codeunits 50111, 50132 | [EventSubscriber(Codeunit,80,OnAfterPostSalesDoc)] |
event subscriber (2) |
Totals: 10 standard objects (8 tables, 2 codeunits); 2 standard tables written directly; 1 posting codeunit called; 2 subscriptions to 1 standard event.
Write detail for the two standard tables (tm writers):
- Table 27: 1 write,
MODIFYat line 417 in the OnRun trigger of Codeunit 50141; theVALIDATE("Unit Price", …)at line 416 is listed as “cannot determine” because the table is not in the export. - Table 7002: 2 certain writes,
INSERTat line 768 andMODIFYat line 769 inCopyToSisterCompany. TheINSERT(l.751) andMODIFY(l.745) inUpsertPriceare “cannot determine”:pSalesPriceis a VAR parameter declared plain, so a caller could pass a temporary record. The only caller (ImportPrices, l.726) passes its locallSalesPrice, which is not temporary (analyst reading oftm uses cu 50140and the declaration).
Sources:
tm find ": Record" --procs(21 hits) andtm find ": Codeunit" --procs(4 hits);tm find EventSubscriber,tm find "DataItemTable=",tm find "TableRelation=";- access:
tm find .INSERT --procs,.MODIFY,.GET(,.FIND,.CALCFIELDS,.RunWithCheck,tm find SalesHeader --procs;tm writers 27,tm writers 7002.
Each variable was matched to its table by hand from these outputs; tm writers and tm uses now give the write side and the inbound references per object, so only the read side of this table is still by hand (gap G2/G5).
Custom-to-custom links
| From | To | Evidence |
|---|---|---|
| Codeunit 50111 Commission Event Subs | Codeunit 50110 Commission Posting → Tables 50100, 50101 | tm refs 50110, tm refs PostCommission(, tm find ": Record" |
| Codeunit 50132 WMS Event Subs | Codeunit 50130 Label Print Mgt | tm refs 50130 |
| Codeunit 50141 Nightly Price Update | Codeunit 50140 Price Feed Import → Table 50142 | tm find CODEUNIT::, tm refs 50142, tm uses cu 50140 (CODEUNIT.RUN at l.411) |
| Report 50151 Customer Sales Export | Codeunit 50150 Excel Export Legacy | tm refs 50150 |
| Page 50100 Sales Commission Entries | Report 50120 (action), Codeunit 50160 (action) | tm find RunObject=, tm find CODEUNIT:: |
| Tables 50100, 50101 | Pages 50100, 50101 (LookupPageID / DrillDownPageID) | tm find LookupPageID --files, tm refs 50100 |
4. Risk flags (LIVE)
| Flag | Count | Where (object / procedure / line) | Evidence | Source |
|---|---|---|---|---|
| DotNet variable | 4 in 2 objects | Codeunit 50130 PrintShipmentLabels l.658 (System.IO.File); Codeunit 50140 ImportPrices l.712–714 (SqlConnection, SqlCommand, SqlDataReader) |
lFile@1003 : DotNet "'mscorlib…'.System.IO.File" |
tm find ": DotNet" --procs |
| Automation variable | 1 | Codeunit 50150 ExportCustomerSales l.462 |
'Microsoft Excel 16.0 Object Library'.Application |
tm find ": Automation" --procs |
| File access | 1 File variable; 2 objects with hard-coded paths | Codeunit 50150 l.463 (File), l.468 and l.476 ('C:\Temp\CustomerSales.csv'); Codeunit 50130 GetLabelFolder l.676–677 ('\\NORTHGATE-FS02\Labels\…') |
lFile.CREATE('C:\Temp\CustomerSales.csv'); |
tm find ": File;", tm find "'C:\", tm find "'\\" |
| Direct SQL | 1 object | Codeunit 50140 ImportPrices l.719: connection string with server PRICESRV01 |
SqlConnection('Data Source=PRICESRV01;Initial Catalog=PriceFeed;…') |
tm find SqlClient --files (3 hits in 1 object), tm find "Data Source=" --procs |
| Hard-coded company name | 2 | Codeunit 50130 GetLabelFolder l.675 (COMPANYNAME = 'Northgate Tools UK Ltd'); Codeunit 50140 CopyToSisterCompany l.764 (CHANGECOMPANY('Northgate Tools Ireland Ltd')) |
as shown | tm find COMPANYNAME --procs, tm find CHANGECOMPANY --procs |
| Hard-coded IDs | 3 | Codeunit 50150 l.465 (USERID <> 'NORTHGATE\FINANCE.ADMIN'); Codeunit 50160 TransferCommission l.121, l.123 (G/L accounts '6150', '2320') |
as shown | tm find USERID --procs, tm find "Account No.\" := '" --procs |
| COMMIT inside a loop | 2 | Codeunit 50140 ImportPrices l.728 (inside WHILE lReader.Read DO BEGIN); Codeunit 50141 OnRun trigger l.418 (inside REPEAT … UNTIL lItem.NEXT = 0) |
tm find COMMIT --procs --context 6 (3 hits; l.421 is after UNTIL, so not flagged) |
|
| Reports | 2 | RDLC layout: 1 (Report 50120). Processing-only: 1 (Report 50151). Word layout: none found [marker unconfirmed]. Classic: not applicable from NAV 2013 on |
tm find "[RDLC layout stripped]" --files, tm find ProcessingOnly=Yes --files, tm find WORDLAYOUT --files |
Line numbers are lines in the LIVE export file. The loop classification for the COMMITs was read from the --context 6 output; v0 automates it (gap G6). The OnRun hit shows no procedure name in tm find, because triggers are not indexed as procedures; tm writers and tm uses do name the trigger (“in OnRun”).
5. Dead-code candidates (LIVE)
Objects with no inbound reference from any other object
| Object | Evidence | Label | Confidence |
|---|---|---|---|
| Codeunit 50115 Commission Calc (Old), COM0.90, date stamp 14/03/19 | tm refs 50115: itself only. tm refs "\"Commission Calc (Old)\"": 0 |
Superseded by Codeunit 50110 (analyst reading) | High |
| Codeunit 50141 Nightly Price Update | tm refs 50141: itself only. Name: 0 |
Has an OnRun trigger: check Job Queue entries | Low (probably scheduled) |
| Page 50131 Label Printer Setup | tm refs 50131: the page itself and Table 50131 only |
Check menus. Table 50131 is used only by this page, and Codeunit 50130 hard-codes the folder instead of reading this setup | Medium |
| Report 50151 Customer Sales Export | tm refs 50151: itself only. Name: 0 |
Check menus and role centres | Low |
Reachable only from a candidate: Codeunit 50140 (called by name only from Codeunit 50141; tm uses cu 50140); Codeunit 50150 (only from Report 50151); Table 50131 (only from Page 50131).
Not candidates:
- Codeunits 50111 and 50132 subscribe to Codeunit 80 (
tm find EventSubscriber). - Codeunit 50160 is run from Page 50100 (
tm refs "\"Commission GL Transfer\""). - Pages 50100 and 50101 are the lookup pages of Tables 50100 and 50101 (
tm find LookupPageID --files). - Report 50120 is run from Page 50100 (
tm refs 50120).
Procedures with no call site
| Procedure | Evidence |
|---|---|
Codeunit 50110 RecalcAllEntries (global) |
tm find RecalcAllEntries --procs: definition line 603 only; tm callers cu 50110 RecalcAllEntries: 0 calls found |
Codeunit 50115 CalcCommission |
tm find CalcCommission --procs: definition only (its object is a candidate) |
Checked and in use, although they are called without parentheses: GetNextEntryNo, GetLabelFolder, TransferCommission, ImportPrices and CopyToSisterCompany (tm find <name> --procs).
Every item above is a candidate to confirm against Job Queue entries, web services and menus; tm itself prints that these “run objects from data, not code”.
Appendix A: Drift between environments
Snapshots (tm snapshots): live@1 and live@2, taken 2026-10-24 15:08:07 and 15:08:08 (demo builds run back to back; the hotfix was applied to the LIVE export between them). UAT and DEV are not snapshotted in this estate on Community: they were read as stand-alone indexes (tm build --source exports/uat --db idx/uat.db, same for DEV) and compared with tm compare live --folder. For UAT → DEV, a second one-environment estate on the UAT export (uatcheck/trussmap.toml, snapshot uat@1) was compared with the DEV folder.
| Comparison | Only in first | Only in second | Different | Same | Source |
|---|---|---|---|---|---|
| LIVE → UAT | 0 | 0 | 4 | 14 | tm compare live --folder exports/uat |
| UAT → DEV | 0 | 2 | 0 | 18 | tm compare uat --folder exports/dev --config uatcheck/trussmap.toml (a one-environment estate on the UAT export) |
| LIVE → DEV | 0 | 2 | 4 | 14 | tm compare live --folder exports/dev |
| LIVE@1 → LIVE@2 | 0 | 0 | 1 | 17 | tm compare live@1 live@2 |
Findings
| # | Object | What differs | Reading | Source |
|---|---|---|---|---|
| D1 | Codeunit 50130 Label Print Mgt | LIVE WMS1.01, UAT/DEV WMS1.00; GetLabelFolder +2/−2 (NORTHGATE-FS02 in LIVE vs NORTHGATE-FS01) |
Changed in LIVE only (history: “changed” at live@2; UAT and DEV still carry WMS1.00). Back-port it before the next deployment | tm history cu 50130; tm compare live --folder exports/uat --object cu 50130; tm sql … --db idx/uat.db, idx/dev.db |
| D2 | Codeunit 50110 Commission Posting | COM1.00 → COM1.01; PostCommission +2/−0 (rate capped at 15) |
Tested change waiting to deploy | tm compare live --folder exports/uat --object cu 50110 |
| D3 | Table 50100 Sales Commission Entry | Field 8 Approved (Boolean) added in UAT/DEV; Version List still COM1.00 | Untagged change: content differs under the same tag | tm compare live --folder exports/uat |
| D4 | Codeunit 50140 Price Feed Import | Version List PRC2.03 on both; ImportPrices +1/−1: PRICESRV01 vs PRICESRV-UAT |
Environment constant in code. Permanent drift; deploying the UAT copy repoints LIVE | tm compare live --folder exports/uat --object cu 50140 |
| D5 | Table 50102 Commission Approval, Page 50102 Commission Approvals | Only in DEV, COM1.02 | Work in progress | tm compare live --folder exports/dev; tm sql … --db idx/uat.db (0 rows) |
On Pro, tm drift records D1 automatically (rule R1: PROD changed without passing through UAT/TEST; R2: UAT holds a stale base) and tm impact lists what a deployment would overwrite. Both were run here and refused on Community (Ref UP-DRIFT, UP-IMPACT); the findings above come from the Community commands listed.
Appendix B: Rules used (v0)
- Custom: ID 50,000–99,999. Modified-standard: standard-range ID with a non-Microsoft Version List tag or
Modified=Yes. - Dependency: VAR/parameter types, object properties (SourceTable, DataItemTable, RunObject, LookupPageID, DrillDownPageID, TableRelation …),
CODEUNIT::"…"name literals,[EventSubscriber]. Access: write = INSERT/MODIFY/DELETE/RENAME; read = GET/FIND/NEXT/CALC*; call = codeunit method or RUN. - Risk flags: DotNet/Automation/OCX types; File type, file functions, path literals; SqlClient/OleDb/ADODB and connection-string literals; literals compared with COMPANYNAME/USERID,
CHANGECOMPANY('…'), literals assigned to account-number fields; COMMIT inside REPEAT…UNTIL or WHILE/FOR…DO BEGIN…END; report layout counts. - Dead code: no inbound reference by ID or name from another object; subscribers and lookup pages excluded; procedures matched by bare name (parameterless calls need no parentheses). Candidates must be confirmed against Job Queue, web services and menus.
- Drift: content hash with Date/Time/Modified stamps removed; Version List counts as content.
Appendix C: Trace
Run in C:\Demo\Northgate\xray on 24 Oct 2026 with Trussmap tm 0.1.0, Community tier (no licence file installed; tm licence status: “community (no licence file covers this estate)”). tm = python -m trussmap. The full output of every command is in xray-runlog.txt in that folder.
- Build:
python make_demo_xray.py --stage base;tm build --env live;python make_demo_xray.py;tm build --env live. This gives snapshots live@1 and live@2. UAT and DEV:tm build --source exports/uat --db idx/uat.db,tm build --source exports/dev --db idx/dev.db(stand-alone indexes, no snapshot). - Section 1:
tm stats(also--db idx/uat.db,--db idx/dev.db);tm sqlgroup-bys onobjects(type, ID band, version_list),procedures, the object list withdateandmodified, and themodified='Yes'filter. - Section 3:
tm findwith": Record",": Codeunit",EventSubscriber,CODEUNIT::,DataItemTable=,SourceTable=,RunObject=,TableRelation=,.INSERT,.MODIFY,.DELETE(0 hits),.GET(,.FIND,.CALCFIELDS,.RunWithCheck,SalesHeader,LookupPageID,DrillDownPageID;tm sqlonfields.table_relation;tm writers 27,tm writers 7002;tm uses cu 50140. - Section 4:
tm findwith": DotNet",": Automation",": File;",SqlClient,"Data Source=","'\\","'C:\",COMPANYNAME,CHANGECOMPANY,USERID,"Account No.\" := '",COMMIT --context 6,"[RDLC layout stripped]",ProcessingOnly=Yes,WORDLAYOUT. - Section 5:
tm refs <id>for all 18 objects;tm refs "<name>"for 6 names;tm refs <Proc>(for 14 procedures;tm find <Proc> --procsfor 7 procedures;tm callers cu 50110 RecalcAllEntries. - Appendix A:
tm snapshots;tm compare live --folder exports/uatandexports/dev;tm compare live@1 live@2;tm buildandtm compare uat --folder exports/devwith--config uatcheck/trussmap.toml;--object cu 50110,cu 50130andcu 50140against the UAT folder;tm historycu 50130, cu 50110, t 50100;tm sqlon objects 50100, 50102, 50110, 50130, 50140 in both stand-alone indexes;tm driftandtm impact live --folder exports/uat(both refused on Community).