The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
OSAdmin
OneStream Employee
5 years agoDoes anyone know how I can use XFSqlTableEditorSaveDataTaskInfo?
Originally posted by Cosimo Palmisano
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?
3 Replies
- OSAdmin
OneStream Employee
Originally posted by Celvin Kattookaranthink you can loop through all editedrows
For Each modRow As XFEditedDataRow In saveDataTaskInfo.EditedDataRowsbrapi.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.
- OSAdmin
OneStream Employee
Originally posted by Frank DossingAs
@Celvin Kattookaran mentions, iterate over the rows, checking if a row if an update/insert/delete type. Then build a sql statement to modify the relevant tables on in the databaseFor 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 NextWhen 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 - OSAdmin
OneStream Employee
Originally posted by Celvin Kattookaranthink you can loop through all editedrows
For Each modRow As XFEditedDataRow In saveDataTaskInfo.EditedDataRowsbrapi.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.
Related Content
- 1 year ago