octobercms/october · error · Error
Record with they key
Error message
Record with they key {key} is not found in the data set What it means
updateRecord() in the client memory data source could not find a record with the given key in its in-memory array (getIndexOfKey returned -1), so an update was requested for a row that no longer exists — usually because the row was deleted or the key column value changed earlier in the session.
Solutions
- Ensure the client-side key column values stay stable while the table is edited
- Refresh the table data after deletions so updates target existing keys
- Check that options.keyColumn matches the field actually holding the record key
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at modules/backend/widgets/table/assets/js/table.datasource.client.js:103 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/ca6347eed445e30e.
Report an issue: GitHub.
Appendix: source
Thrown at modules/backend/widgets/table/assets/js/table.datasource.client.js:103
this.getRecords(offset, count, onSuccess)
}
/*
* Updates a record with the specified key with the passed data
*
* - key - the record key in the dataset (primary key, etc)
* - recordData - the record fields.
*/
Client.prototype.updateRecord = function(key, recordData) {
var recordIndex = this.getIndexOfKey(key)
if (recordIndex !== -1) {
recordData[this.tableObj.options.keyColumn] = key
this.data[recordIndex] = recordData
}
else {
throw new Error('Record with they key '+key+ ' is not found in the data set')
}
}
/*
* Deletes a record with the specified key.
*
* - key - the record key in the dataset (primary key, etc).
* - newRecordData - replacement record to add to the dataset if the deletion
* empties it.
* - offset - the current page's first record key (zero-based)
* - count - number of records to return
* - onSuccess - a callback function to execute when the updated data gets available.
*
* The onSuccess callback parameters: records, totalCount.
*/
Client.prototype.deleteRecord = function(key, newRecordData, offset, count, onSuccess) {
var recordIndex = this.getIndexOfKey(key)
View on GitHub (pinned to b608633a7e)