09-30-2020 09:59 AM
7/19/2018
I've got a SQL Table Editor component in a dashboard that queries an SQL View that outer joins two tables. The user can update some fields in a record within the SQL Table Editor component and when they hit save, I call a Dashboard Extender rule that processes the dirty records within the component. The rule starts off by creating an XFSqlTableEditorSaveDataTaskInfo object but not sure where to take it from here. There's the property XFSqlTableEditorSaveDataTaskInfo.EditedDataRows which I assume is a collection of dirty records from the Table component. I'd like to get the ModifiedDataRow values on fields that were updated in the table component so I can write them back to one of the source tables used in the SQL view. Anyone have an example on how to get the value from a modified field?
09-30-2020 10:33 AM
think you can loop through all editedrows
For Each modRow As XFEditedDataRow In saveDataTaskInfo.EditedDataRows
brapi.ErrorLog.LogMessage(si, modRow.ModifiedDataRow.Item(""columname"").ToString)
Next
You cannot update a view you need to update underlying tables. It works fine for me if I update the data from a table.
10-01-2020 11:23 PM
As
For Each row as XFEditedDataRow in args.SqlTableEditorSaveDataTaskInfo
If row.InsertUpdateOrDelete = DbInsUpdateDelType.Update
'If a row is updated, add to an "Update" sql command
ElseIf row.InsertUpdateOrDelete = dbInsUpdateDelType.Insert
'If a row is an insert, add to an "Insert" sql command
End if
Next
When returning from the function, make sure to return a XFSqlTableEditorSaveDataTaskResult object, setting the '.CancelDefaultSave' to true:
Dim xfResult As New XFSqlTableEditorSaveDataTaskResult
xfResult.CancelDefaultSave = True
xfResult.IsOK = True
xfResult.ShowMessageBox = False
Return xfResult
10-19-2020 08:05 AM
think you can loop through all editedrows
For Each modRow As XFEditedDataRow In saveDataTaskInfo.EditedDataRows
brapi.ErrorLog.LogMessage(si, modRow.ModifiedDataRow.Item(""columname"").ToString)
Next
You cannot update a view you need to update underlying tables. It works fine for me if I update the data from a table.