Forum Discussion
Not sure why you are trying to remove the insert and updates.
Private Sub SaveRecords(si As SessionInfo, args As DashboardExtenderArgs)
Try
Using dbConn As DBConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si)
dbConn.BeginTrans()
BRApi.Database.SaveDataTableRows(dbConn, args.SqlTableEditorSaveDataTaskInfo.SqlTableEditorDefinition.TableName, args.SqlTableEditorSaveDataTaskInfo.Columns, args.SqlTableEditorSaveDataTaskInfo.HasPrimaryKeyColumns, args.SqlTableEditorSaveDataTaskInfo.EditedDataRows, True, False, True)
dbConn.CommitTrans()
end using
Catch ex As Exception
Throw New XFException($"{Environment.NewLine}{Me.GetType().ToString()}.{System.Reflection.MethodBase.GetCurrentMethod().Name}(): {ex.Message}", ex)
End Try
End Sub
Is the above not working? Also I do see why you are creating a DbConn variable, but a Using should works just fine isn't it?
- RobbSalzmann2 years agoValued Contributor II
Since the STE cannot save the data on its own, I parse the modified rows and save the updates/inserts with queries.
The modified rows must be removed to allow the UI to refresh and update the STE with new (manually updated) entries.If I use the default SQL Table Editor code supplied by OneStream in the Rule, the error in the log is:
A using block implies the System.IDisposeable interface is implemented. DBConnInfo does not seem implement this interface. I find outside declarations and the Try-Catch-Finally approach is better for debugging. - RobbSalzmann2 years agoValued Contributor II
ckattookaran I replaced my code with yours and ran it. Here are the results:
IMO, the default STE helper code supplied with the Dashboard Extender rules is flawed in its error handling. I use what I posted to overcome this.
Related Content
- 11 months ago
- 8 months ago