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
Shivangi
2 years agoNew Contributor III
How to make use of 'SaveDataTableRows()'
Dear Community,
Can anyone please guide me the proper usage of the function
BRApi.Database.SaveDataTableRows(dbConnApp, tableName, columns, hasPrimaryKeyColumns, editedDataRows, throwIfRowForUpd...
- 2 years ago
Here is an example from the MarketPlace app Data Import Schedule Manager (DSM):
'convert the ado.net data table to an XF data table to access the tables' XF data rows Dim xfBalanceDT As New XFDataTable(si, auditTableSchema, Nothing, 1) Dim editedXFDataRows As New List(Of XFEditedDataRow) Dim newXFRow As New XFDataRow() newXFRow("TaskID") = randomGuid newXFRow("SourceDataOriginType") = SourceDataOriginType newXFRow("WorkFlowSteps") = workFlowSteps newXFRow("ParallelBatchCount") = ParallelBatch newXFRow("LoadMethod") = loadMethod newXFRow("WFTimePeriods") = timePeriods newXFRow("WFScenarios") = scenarios newXFRow("Workflows") = workflows newXFRow("TimeStamp") = DateTime.Now newXFRow("UserName") = si.UserName newXFRow("EmailTemplateID") = emailTemplate newXFRow("AddlDataMgmtTask") = addlTask newXFRow("AddlTaskBeforeOrAfter") = beforeOrAfter Dim xfRow As New XFEditedDataRow(DbInsUpdateDelType.Insert, Nothing, newXFRow) editedXFDataRows.Add(xfRow) 'Inserting the row into our table Using dbConnInfo As DbConnInfoApp = BRApi.Database.CreateApplicationDbConnInfo(si) BRApi.Database.SaveDataTableRows(dbConnInfo, "XFW_DSM_WorkflowImports", xfBalanceDT.Columns, True, editedXFDataRows, False, False, True) End Using
MarcusH
2 years agoValued Contributor
Here is an example from the MarketPlace app Data Import Schedule Manager (DSM):
'convert the ado.net data table to an XF data table to access the tables' XF data rows
Dim xfBalanceDT As New XFDataTable(si, auditTableSchema, Nothing, 1)
Dim editedXFDataRows As New List(Of XFEditedDataRow)
Dim newXFRow As New XFDataRow()
newXFRow("TaskID") = randomGuid
newXFRow("SourceDataOriginType") = SourceDataOriginType
newXFRow("WorkFlowSteps") = workFlowSteps
newXFRow("ParallelBatchCount") = ParallelBatch
newXFRow("LoadMethod") = loadMethod
newXFRow("WFTimePeriods") = timePeriods
newXFRow("WFScenarios") = scenarios
newXFRow("Workflows") = workflows
newXFRow("TimeStamp") = DateTime.Now
newXFRow("UserName") = si.UserName
newXFRow("EmailTemplateID") = emailTemplate
newXFRow("AddlDataMgmtTask") = addlTask
newXFRow("AddlTaskBeforeOrAfter") = beforeOrAfter
Dim xfRow As New XFEditedDataRow(DbInsUpdateDelType.Insert, Nothing, newXFRow)
editedXFDataRows.Add(xfRow)
'Inserting the row into our table
Using dbConnInfo As DbConnInfoApp = BRApi.Database.CreateApplicationDbConnInfo(si)
BRApi.Database.SaveDataTableRows(dbConnInfo, "XFW_DSM_WorkflowImports", xfBalanceDT.Columns, True, editedXFDataRows, False, False, True)
End Using
Shivangi
2 years agoNew Contributor III
Thank You Very Much!!
Related Content
- 3 years ago