updateRow not updated my table dataset

newValue = event.newValue
oldValue = event.oldValue
row = event.row
column = event.column

if(newValue == "pre" or newValue == "post"):
	fpmi.db.runPrepStmt("UPDATE tblMaltDataSNB SET TestType = ? WHERE MALTSNBID = ?",[newValue, intMALTSNBID])
else:
	dictTestType = {"TestType":oldValue}
	fpmi.dataset.updateRow(event.source.data, row, dictTestType)
	fpmi.gui.warningBox('The test type can only be "pre" or "post".')

I have this code on the cellEdited event of a table. I would like the cell of the dataset to revert back to the old value if the new value is not equal to the strings “pre” or “post”

I do not receive any errors when this code fires, but the cell of the dataset does not revert back either.

Your second to last line (the call to fpmi.dataset.updateRow) isn’t doing anything useful. It is taking the table’s dataset, making a new dataset with the updated row, and returning it, but you’re not doing anything with the return value. Simply change the second to last line to be :

   event.source.data = fpmi.dataset.updateRow(event.source.data, row, dictTestType)

Hope this helps,