I have the following code in the onCellEdited extension function of a power table.
I cant seem to get the runPreUpdate to work. Any assistance would be appreciated.
IA v7.7.5
[code] import system
dataSource = "CapitalProjectsDB"
# The row index of the edited row
row = rowIndex
# The column index of the edited column
col = colIndex
# The name of the edited column
colName = colName
# The new value entered by the user
value = newValue
# get the ID (primary key)
ID = self.data.getValueAt(row,0)
#string that is the query section below in the runPrepUpdate
query = "UPDATE [WBS Table Detail] SET Comments = (?) WHERE ID = (?)"
# list of values represented in string above by ‘?’ marks in the values portion of runPrepUpdate
values = [value,ID]
try:
system.db.runPrepUpdate(query,values,dataSource)
except:
system.gui.warningBox("SQL Insert Failed")[/code]