How do I clean a scenario before copying data from another scenario? in the member formula.
Hi Everyone. I want to copy the information from one scenario to another. Currently, I’m using the member formula of the target scenario to transfer the data. However, I first apply a calculate to set the values to zero, followed by a clecarcalculateddata to properly remove the existing information. The issue is that after this step, the copy process doesn’t execute, and the scenario remains with zero values. My code is as follows: api.Data.calculate("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE = 0*(S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE)",True) api.Data.ClearCalculatedData("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE",True,True,True,True) Dim destinationInfo As ExpressionDestinationInfo = api.Data.GetExpressionDestinationInfo("S#FORECAST_" & monthNumber & "_AT_CY_BUDGET_RATE") '' Create new Databuffer for the results Dim resultDataBuffer As New DataBuffer 'Base Entity at Local If Not api.Entity.HasChildren And api.Cons.IsLocalCurrencyForEntity() Then BRapi.ErrorLog.LogMessage(si,"Validate 1") ' Get Databuffer from the account and scenario Dim sourceDataBuffer As DataBuffer = api.data.GetDataBufferUsingFormula("RemoveZeros(FilterMembers(S#[Forecast " & TimeName & "],[A#Root.Base]))", , False) ' Verificar si hay celdas con datos If sourceDataBuffer.DataBufferCells.Count > 0 Then BRapi.ErrorLog.LogMessage(si,"Validate 2") For Each sourceCell As DataBufferCell In sourceDataBuffer.DataBufferCells.Values If (Not sourceCell.CellStatus.IsNoData) And (sourceCell.CellAmount <> 0.0) Then BRapi.ErrorLog.LogMessage(si,"Validate 3") Dim resultCell As New DataBufferCell(sourceCell) resultCell.DataBufferCellPk.OriginId = DimConstants.Import resultDataBuffer.SetCell(si, resultCell, True) End If Next api.Data.SetDataBuffer(resultDataBuffer, destinationInfo,,,,,,,,,,,,,False) End If End If I would appreciate your help in understanding why the values are not being copied. The process is executed when I consolidate the information.15Views0likes1CommentIs there an example of using System.Reflection namespace with OneStream APIs
I'm driving myself a little crazy at the moment. Sometime in the last few days, I stumbled across a Community Post (I think) about how to use System.Reflection to programmatically list OneStream API object methods, overloads, parameters, etc. At the time I saw it, I thought "Oh, that's cool!" and remembered that if I needed to find it again, I just needed to search for "Reflection" in community posts. Well, for the life of me, I can't find the post again. Does anyone know of a post that describes how to use System.Reflection's methods, like GetMethods on OneStream API objects? I know I'm being lazy and could work out the code myself, but what I read had already worked out the BindingFlags and other parameters on the calls that were specific to OneStream.9Views0likes0CommentsDataManagementEventHandler Args
Hi, I try to get the data unit information of different DM steps, such as Calculate, Copy Data, Reset Scenario, Clear Scenario, Custom Calculate. For a regular "Calculate" I'll get the information via Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DataManagementEventHandlerArgs) As Object Dim sbLog As New Text.StringBuilder Try Dim returnValue As Object = args.DefaultReturnValue Dim dmStepMetadataInfo As DataMgmtStepMetadataInfo If args.OperationName = BREventOperationType.DataManagement.ExecuteStep Then dmStepMetadataInfo = DirectCast(args.inputs(0), DataMgmtStepMetadataInfo) Dim entList As String = String.Join(",",dmStepMetadataInfo.EntityInfos.Select(Function(miMem) miMem.member.Name).ToList().ToArray()) as it is described in another communits-post. But if I do a "Copy Data", I don't know how to get the submitted data unit. args.inputs(0) is of type OneStream.Finance.Engine.DataMgmtStepMetadataInfo as far as I know from using the error log messages. But there is no documentation of the type "DataMgmtStepMetadataInfo" and I won't get the data unit infos the same way I did in the code above. args.inputs(1) is less interesting. It contains the user name, the DM step description and task activity information. There are no more args inputs. Any ideas how to pull the data unit information out of "DataMgmtStepMetadataInfo"? Regards, Marcus82Views0likes1CommentSupplied parameter tied to Bound List not returning value
Hi community, I have an issue where i have a member list tied to a bound list. The bound list uses a SQL query to get the top member of a given dimension. I have this bound list tied to a supplied parameter that I have attached to a dashboard. The issue is that when I run the dashboard, it is not triggering the bound list, even though i am using the supplied parameter. If I remove the supplied parameter and run the dashboard, it prompts me with the bound list parameter showing the value i want to return, and thereafter, when i put the supplied parameter back it works. It seems like the system needs to trigger the bound list first, but I haven't found a way to do so yet. Any thoughts?Solved75Views0likes3CommentsVersion 9.0 Redacting information in Error Log
Dear Community Members, Has anyone experienced information in the log being redacted. I found this in the latest documenation. However, i see no pattern of what is considered sensitive. I have a data table dump in the decimal positions are redacted. I am logging the keys and values of two dictionaries. in both dictionaries the value is an integer. One value is shown while the other value in redacted. Both values come from a text member of a dimension member. In other cases i am logging the name of the business rule and the name of the function. Sometimes the RULENAME is redacted, sometimes it is not. Which leads me to believe that the logic thinks that the name is sensitive?! Is this sensitivity controllable maybe on the app settings on the server? Cause it seems overly sensitive or plainly wrong in determining what is sensitive and what is no.251Views0likes8CommentsHow can I subtract the result of two DIVIDE operations within a CALCULATE function?
Hi Everyone. I have the following CALCULATE expression, but it’s returning no results. The source values are not zero, so I’m not sure if the way I’m using the DIVIDE function is causing the issue, or if there is another problem Dim DBCInner As DataBuffer = api.Data.GetDataBufferUsingFormula("FilterMembers(A#RETBUYBACK:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#COUNTRY_RPT + A#423100:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#COUNTRY_RPT + A#411000:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#COUNTRY_RPT)") api.Data.FormulaVariables.SetDataBufferVariable("DBCInner",DBCInner,False) Dim regionalRpt As DataBuffer = api.Data.GetDataBufferUsingFormula("FilterMembers(A#RETBUYBACK:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#REGIONAL_RPT + A#423100:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#REGIONAL_RPT + A#411000:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#REGIONAL_RPT)") api.Data.FormulaVariables.SetDataBufferVariable("rptValue",regionalRpt,False) api.Data.Calculate("A#P_EBIPrct:O#Import:U2#P0000:UD3#REG_ADJ:U4#PJ00000 = Divide($rptValue,A#411000:E#"& strEntTx3 &":C#Local:O#Top:U2#INNER:UD3#REGIONAL_RPT) - Divide($DBCInner, A#411000:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#COUNTRY_RPT)") I would appreciate your assistance.41Views0likes1CommentFileShare 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.Solved69Views1like3CommentsIssue Enabling User via API – SaveUser() Fails with “User Already Exists” Error
Hi! We’ve developed a custom REST API in our OneStream application to automate user management. So far, the following methods are working successfully: CreateUser – Creates a new user DisableUser – Disables an existing user Now, we are trying to add a new method: EnableUser – This method receives a user name and sets the IsEnabled property to True. The logic is quite simple. We retrieve the existing user using: Public Sub EnableUser() ' Get user name Dim username As String = Me._UserProperties("name") If String.IsNullOrEmpty(username) Then Throw New Exception($"Supplied name is empty") ' Get user Dim userToEnable As UserInfo = BRApi.Security.Authorization.GetUser(Me._Si, username) If userToEnable Is Nothing Then Throw New Exception($"User '{username}' was not found in OneStream") ' Set IsEnabled = True userToEnable.User.IsEnabled = True Try BRApi.Security.Admin.SaveUser(Me._Si, userToEnable.User, False, Nothing, TriStateBool.TrueValue) Catch ex As Exception Throw New Exception("Problem enabling user, Error message: " + Environment.NewLine + ex.GetBaseException.Message) End Try Me._Logger.AppendToLogger($"User '{username}' has been enabled") End Sub However, when we try to execute this method, we get the following error: Problem enabling user, Error message: Error saving User. 'Test' already exists. This seems misleading because we're not trying to create a new user—we're retrieving an existing one and updating it. The createNewUser flag is explicitly set to False, and we are using the original UserInfo.User object returned by the API. We’ve ensured that all key properties like Name, UserType, Email, etc., are populated. It seems that SaveUser() is still attempting to create a new user instead of updating the existing one. Has anyone encountered this behavior before? Is there a specific requirement or workaround to ensure SaveUser() correctly recognizes an update instead of a creation? Any insights or guidance would be greatly appreciated. Regards, XaviSolved35Views0likes2CommentsAccount Reconcillations (RCM) Excluding an Import from Actuals
Hi All, I am currently setting up account reconcillations manager (RCM) and import both YTD GL data and Periodic Flow data in the actual scenario. I want to bring in just the YTD GL data into RCM, but it's bringing in both data sets. How can I exclude the Import Flow Data? I know that I can filter on the workflow profile "Import Flow Data" in the Account Rec inventory and delete them, but I'd rather the flow data just not come into RCM in the first place. Thanks for the help!Solved47Views0likes3Comments