Clearing Files in User Temp Folder as Non Admin
Good afternoon, Does anybody know which security setting would allow a user to delete files from their Temp Folder? I have tried changing the below System and Application Security Roles with no luck. Each time i get an error saying the User does not have permission to write to that folder. Private Sub ClearUserTempFolder(ByVal si As SessionInfo) Try Dim userName As String = si.UserName.Replace(" ", "") Dim location As FileSystemLocation = FileSystemLocation.ApplicationDatabase Dim folderPath As String = $"Internal/Users/{userName}/Temp" Dim fileTypeFilter As XFFileType = XFFileType.All Dim contentFileExtensionFilters As List(Of String) = Nothing ' Get list of files Dim objList As List(Of XFFileInfoEX) = BRApi.FileSystem.GetFilesInFolder(si, location, folderPath, fileTypeFilter, contentFileExtensionFilters) If objList IsNot Nothing AndAlso objList.Count > 0 Then For Each file In objList Try BRApi.FileSystem.DeleteFile(si, location, file.XFFileInfo.FullName) BRApi.ErrorLog.LogMessage(si, $"Deleted file: {file.XFFileInfo.FullName}") Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try Next Else BRApi.ErrorLog.LogMessage(si, $"No files to delete in {folderPath}") End If Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Sub10Views0likes1CommentMember Description using FdxExecuteDataUnitTimePivot
Hi. I am using the FdxExecuteDataUnitTimePivot to pull data through a Data Adapter. My Setup now is only pulling the Names of the dimension members. Is there any way to get the descriptions as well? My Code: Public Function ToNexusSalaryBridge(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardDataSetArgs) Dim sScenario As String = args.NameValuePairs.XFGetValue("myScenario", String.Empty) Dim sYear As String = args.NameValuePairs.XFGetValue("myTime", String.Empty) Dim sWorkspaceID As Guid = BRApi.Dashboards.Workspaces.GetWorkspaceIDFromName(si, False, "Default") Dim sRootEntity As String = "MyRootEntity" Dim cubeName As String = "Test" '# data unit dims Dim consName As String = "Aggregated" 'member name only, no dim token Dim scenarioTypeId As Integer = ScenarioType.Budget.Id Dim viewName As String = "Periodic" 'member name only, no dim token Dim entityDimName As String = "E_ELTBU" Dim entityMemFilter As String = $"E#[{sRootEntity}].Base" Dim scenarioDimName As String = "S_ReportingScenarios" Dim scenarioMemFilter As String = $"S#[{sScenario}]" Dim timeMemFilter As String = $"T#{sYear}.Base" Dim suppressNoData As Boolean = True Dim parallelQueryCount As Integer = 8 Dim logStatistics As Boolean = False ' '# SQL like filter on output table Dim filter As String = "Flow='DKK_Input' and UD2='member1' and IC='None' and UD6='None' and UD7='None' and UD8='None'" Dim Dt As DataTable = BRApi.Import.Data.FdxExecuteDataUnitTimePivot(si, _ cubeName, _ entityMemFilter, consName, _ scenarioTypeId, scenarioMemFilter, _ timeMemFilter, viewName, _ suppressNoData, False, filter, parallelQueryCount, logStatistics) If Dt IsNot Nothing Then Return Dt End If End FunctionSolved21Views1like1CommentFileShare Harvest Folder view and deletion
Hello All, Our initial setup had everything copying data files to Application/Batch/Harvest folder. There has been multiple years of files stored in this location making it unable to open. I am trying to create something to pull the files and if folders are created to delete the stored files. I am uable to open the path and the clean up business rule fails to run due to the size. I spoke with some developers at Nashville Splash and am reaching out on here as well.6Views1like0CommentsHelp with Table Views
Hello, I'm attempting to create my first table view using the syntax below. The SQL is a very basic record grab from DataEntryAuditSource (initial POC). Compiles fine and seems to be okay relative to the user guide, but I keep getting an error message when I attempt to run. Does anyone have any thoughts on what I could be doing wrong? Thanks, Sean ----- Imports System Imports System.Collections.Generic Imports System.Data Imports System.Data.Common Imports System.Globalization Imports System.IO Imports System.Linq Imports Microsoft.VisualBasic Imports OneStream.Finance.Database Imports OneStream.Finance.Engine Imports OneStream.Shared.Common Imports OneStream.Shared.Database Imports OneStream.Shared.Engine Imports OneStream.Shared.Wcf Imports OneStream.Stage.Database Imports OneStream.Stage.Engine Namespace OneStream.BusinessRule.Spreadsheet.UTM_TaskList Public Class MainClass Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As SpreadsheetArgs) As Object Try Select Case args.FunctionType ' Case Is = SpreadsheetFunctionType.Unknown ' Case Is = SpreadsheetFunctionType.GetCustomSubstVarsInUse Case Is = SpreadsheetFunctionType.GetTableView If args.TableViewName.Equals("SeansFirstTableView") Return GetUTMTaskListExport(si) End If ' Case Is = SpreadsheetFunctionType.SaveTableView End Select Return Nothing Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function #Region "Get Table Views" Private Function GetUTMTaskListExport(ByVal si As SessionInfo) As TableView Try Dim SQL_TaskListExport_L As New Text.StringBuilder SQL_TaskListExport_L.AppendLine(" SELECT DataEntryAuditSource.UserID as ID, DataEntryAuditSource.TimeStamp as TimeStamp, DataEntryAuditSource.UniqueID as RecordID, DataEntryAuditSource.CubeVieworFileName as Format, DataEntryAuditSource.DataEntryType as Type, FROM DataEntryAuditSource ") 'Create and fill the DataTable Dim DT_TaskListExport_L As DataTable = Nothing Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si) dt_TaskListExport_L = BRApi.Database.ExecuteSql(dbConnApp, sql_TaskListExport_L.ToString, False) If Not dt_TaskListExport_L Is Nothing Then dt_TaskListExport_L.TableName = "NoData" End Using 'Create and Populate Table View Dim tv_TaskListExport As New TableView() tv_TaskListExport.PopulateFromDataTable(dt_TaskListExport_L, True, True) 'Table View Settings and Formatting tv_TaskListExport.CanModifyData = False tv_TaskListExport.HeaderFormat.BackgroundColor = XFColors.XFDarkBlueBackground tv_TaskListExport.HeaderFormat.TextColor = XFColors.White tv_TaskListExport.HeaderFormat.IsBold = True tv_TaskListExport.Columns.Item(1).ColumnFormat.ColumnWidth = 15 Return tv_TaskListExport Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function 'GetUTMTaskListExport #End Region End Class End Namespace49Views0likes3Commentsdetermining parent by hierarchy
tldr: What's a performant, reliable way to determine a member's parent within a given hierarchy? I have been developing a custom extender rule to automate OneStream metadata updates based on our master metadata source. One of the last remaining tasks to solve is how to correctly execute member moves. As OneStream can have a given member exist multiple times in the same dimension, the only way to execute a move in OneStream is by specifying "move from parent A to parent B." Parent B is quite easy to determine as our metadata source provides this information per-hierarchy and does not allow duplicates but it does not tell us parent A, or even if there was a move at all. This means I have to validate that the specified member 1) is under the same parent that our metadata source says it should be and 2) isn't anywhere else in the hierarchy. However, in OneStream, I know of no way to query the parent(s) of a member but only those within a specific hierarchy. I've never needed to do this in a BR before but I have definitely been stung by this limitation while working with QVs in the past. This makes it feel like a common-enough need that there's probably a way to do it that I'm just unaware of. If not, I'll have to code it myself and I could use some insight into a performant and logically-sound way to do it. So far, the only approach I can imagine is this: BR API GetDescendants to pull all members in a hierarchy. Verify the child exists in the hierarchy. BR API GetParents to pull all parents of the child. Iterate through each parent to see which one(s) exists in the hierarchy. If there's only one and it differs from the one provided by our metadata source, move it. If there are multiple, oh bother. However, I foresee a lot of unpleasant little surprises in developing this. I also worry about performance as there's a Cartesian product of the number of descendants times the number of parents. Even if it's speedy, it still seems like a very indirect route to take for what is conceptually simple. What's the better way to do this?101Views0likes17CommentsOutbound Files through SIC Using UNC
Need some ideas on how to out bound files from OS shared folders to a network driver using UNC through SIC (we are upgrading to 8.2 from 7.3). We have SFTP through SIC works already, however, this specific process cannot be replaced by SFTP at this time. I have seen discussions and recommendation about inbounding through SIC only.607Views0likes5Comments