The cost record number of the transaction line is not valid" — Sage 50 error
Sage 50 is rejecting a transaction because an internal cost-tracking reference on a line item is corrupted or points to a missing record.
When Sage 50 shows “The cost record number of the transaction line is not valid,” it means the program found a transaction line whose internal link to a cost record is broken — the reference number either points to a record that no longer exists, points to the wrong record, or has been corrupted. In plain terms, Sage 50 cannot match a line on a purchase, invoice, or adjustment to the underlying cost data it expects to find, so it refuses to process or save the transaction.
This is a data-integrity problem inside the company file, not a typing mistake on your part. The message typically appears after a power failure, a network drop while Sage 50 was writing, a hard shutdown, or simply gradual file growth that has pushed a fragile internal index past its limit. It can also surface when inventory or purchase cost data was partially written and then interrupted, leaving a transaction line with a cost pointer that leads nowhere.
Run Sage 50’s built-in data verification
If you can still open the company file, start with Sage 50’s internal check and repair tools. The exact menu path depends on your version of Sage 50 (US Peachtree edition or Canadian Simply Accounting edition), so look for the file-maintenance or data-verification option in your administration or file menu. Run the verification first, then the repair or rebuild if verification reports problems. This resolves the issue when the damage is limited to a simple index inconsistency.
Restore from your most recent backup
If verification and repair do not clear the error — or if the file will not stay open long enough to run them — restore your most recent backup. The trade-off is obvious: you lose every transaction entered since that backup was made. If the gap is a day or two, this is usually the safest path. If the gap is weeks or months, the cost of re-entry may be high enough that professional repair is the better option.
Do not keep retrying the same transaction
Repeatedly attempting to save, edit, or delete the problem transaction can deepen the corruption, especially if the issue involves inventory cost layers. If Sage 50 rejects the same line twice, stop and choose one of the options above rather than forcing it.
When the file needs professional attention
If neither verification nor a backup restore is viable, the company file likely has structural damage to its cost-tracking tables that Sage 50’s built-in tools cannot repair. Our engineers regularly rebuild Sage 50 / Simply Accounting databases with exactly this kind of internal reference corruption, re-linking cost records to their transaction lines without losing the surrounding data. The approach and feasibility depend entirely on what is inside your specific file, so we offer a free evaluation and quote — cost and turnaround depend on the extent of the damage and the size of the file.
If you are also considering moving away from Sage 50 entirely, a damaged file can often be converted to QuickBooks as part of the recovery process, which may save the re-entry work either way.