The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Widgets
Recent Discussions
Need help on Clear Specific member data
Hi Team, I need your support regarding an issue I am facing with the dashboard-driven data clearing logic. Requirement: When specific Dimension/Members are selected in the dashboard, the attached code is expected to execute in Preview and Clear modes to remove the corresponding data. Issue Observed: The code runs successfully during execution. I can see the log message indicating that the data is “cleared.” However, the actual data is not getting cleared from the system. This suggests that while the process is triggering correctly, the clearing operation is not impacting the underlying data as expected. Could you please review and provide your suggestions on what might be causing this issue or any potential gaps in the approach? Let me know if you need additional details or logs from my end. Thanks in advance for your help. api.Data.SetDataCell(memberScript, amount, isNoData, isDurableCalculatedData) 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.Finance.EPM_Clear_Specific_Scenarios Public Class MainClass Public Function Main(si As SessionInfo, globals As BRGlobals, api As FinanceRulesApi, args As FinanceRulesArgs) As Object Try '======================================== ' VALID FUNCTION TYPE '======================================== If api.FunctionType <> FinanceFunctionType.CustomCalculate Then Return Nothing End If '======================================== ' PARAMETERS '======================================== Dim entityName As String = GetParam(args, "Entity") Dim scenarioName As String = GetParam(args, "ParamSScenario") Dim timeName As String = GetParam(args, "Time") Dim con as String="Local" Dim accountName As String = GetParam(args, "Account") Dim flowName As String = GetParam(args, "Flow") Dim originName As String = GetParam(args, "Origin") Dim icName As String = GetParam(args, "IC") Dim ud1 As String = GetParam(args, "UD1") Dim ud2 As String = GetParam(args, "UD2") Dim ud3 As String = GetParam(args, "UD3") Dim ud4 As String = GetParam(args, "UD4") Dim ud5 As String = GetParam(args, "UD5") Dim ud6 As String = GetParam(args, "UD6") Dim ud7 As String = GetParam(args, "UD7") Dim ud8 As String = GetParam(args, "UD8") Dim mode As String = GetParam(args, "Mode", "EXECUTE").ToUpper() Dim confirmDelete As String = GetParam(args, "ConfirmDelete", "NO").ToUpper() api.LogMessage("=== DATABUFFER CLEAR START ===") api.LogMessage("Mode=" & mode & " | ConfirmDelete=" & confirmDelete) '======================================== ' VALIDATION '======================================== If String.IsNullOrWhiteSpace(accountName) Then Throw New Exception("Account parameter is required.") End If '======================================== ' BUILD FILTER '======================================== Dim filter As String = "E#" & entityName & ":S#" & scenarioName & ":T#" & timeName & ":A#" & accountName If Not String.IsNullOrWhiteSpace(flowName) Then filter &= ":F#" & flowName If Not String.IsNullOrWhiteSpace(originName) Then filter &= ":O#" & originName If Not String.IsNullOrWhiteSpace(icName) Then filter &= ":I#" & icName If Not String.IsNullOrWhiteSpace(Con) Then filter &= ":C#" & "Local" If Not String.IsNullOrWhiteSpace(ud1) Then filter &= ":U1#" & ud1 If Not String.IsNullOrWhiteSpace(ud2) Then filter &= ":U2#" & ud2 If Not String.IsNullOrWhiteSpace(ud3) Then filter &= ":U3#" & ud3 If Not String.IsNullOrWhiteSpace(ud4) Then filter &= ":U4#" & ud4 If Not String.IsNullOrWhiteSpace(ud5) Then filter &= ":U5#" & ud5 If Not String.IsNullOrWhiteSpace(ud6) Then filter &= ":U6#" & ud6 If Not String.IsNullOrWhiteSpace(ud7) Then filter &= ":U7#" & ud7 If Not String.IsNullOrWhiteSpace(ud8) Then filter &= ":U8#" & ud8 api.LogMessage("Filter used: " & filter) '======================================== ' GET DATABUFFER '======================================== Dim dataBuffer As DataBuffer = api.Data.GetDataBufferUsingFormula(filter) If dataBuffer Is Nothing _ OrElse dataBuffer.DataBufferCells Is Nothing _ OrElse dataBuffer.DataBufferCells.Count = 0 Then api.LogMessage("No data found for given filter.") Return Nothing End If Dim totalCells As Integer = dataBuffer.DataBufferCells.Count api.LogMessage("Cells found: " & totalCells) '======================================== ' SAFETY LIMIT '======================================== If totalCells > 500000 Then Throw New Exception("Too many records selected (" & totalCells & "). Reduce filter.") End If '======================================== ' PREVIEW MODE '======================================== If mode = "PREVIEW" OrElse confirmDelete <> "YES" Then Dim previewCount As Integer = 0 For Each kvp As KeyValuePair(Of DataBufferCellPk, DataBufferCell) In dataBuffer.DataBufferCells api.LogMessage("PREVIEW: " & kvp.Value.CellAmount) previewCount += 1 Next Dim preview As New StringBuilder() preview.AppendLine("DATA SELECTED FOR CLEAR") preview.AppendLine("====================================") preview.AppendLine("Filter :") preview.AppendLine(filter.ToString()) preview.AppendLine("") preview.AppendLine("Total Cells : " & totalCells.ToString("N0")) 'preview.AppendLine("Total Amount: " & Kvp.value.cellamount.ToString("F2")) api.LogMessage("Total PREVIEW cells: " & previewCount) BRApi.Dashboards.Parameters.SetLiteralParameterValue( si, True, "ETPreviewData", preview.ToString()) Return Nothing End If '======================================== ' CLEAR MODE '======================================== Dim clearedCount As Integer = 0 Dim skippedCount As Integer = 0 For Each kvp As KeyValuePair(Of DataBufferCellPk, DataBufferCell) In dataBuffer.DataBufferCells Try Dim cellPk As DataBufferCellPk = kvp.Key Dim memberScriptBuilder As New MemberScriptBuilder() api.Data.ApplyDataBufferCellPkToMemberScriptBuilder(memberScriptBuilder, cellPk) Dim writeScript As String = memberScriptBuilder.GetMemberScript.ToString api.LogMessage("WriteScript" & writescript.ToString()) api.Data.SetDataCell(writeScript, 0D, True,True) clearedCount += 1 Catch exInner As Exception skippedCount += 1 api.LogMessage("SKIPPED: " & kvp.Value.CellAmount.ToString("F2") & " | Error: " & exInner.Message) End Try Next '======================================== ' SUMMARY '======================================== api.LogMessage("=== CLEAR SUMMARY ===") api.LogMessage("Script :" & filter ) api.LogMessage("Total Cells : " & totalCells) api.LogMessage("Cleared : " & clearedCount) api.LogMessage("Skipped : " & skippedCount) api.LogMessage("=== DATABUFFER CLEAR END ===") Return Nothing Catch ex As Exception Throw ErrorHandler.LogWrite(si, ex) End Try End Function '======================================== ' PARAM HELPER '======================================== Private Function GetParam(args As FinanceRulesArgs, name As String, Optional def As String = "") As String Try Dim v As String = args.CustomCalculateArgs.NameValuePairs.XFGetValue(name) If String.IsNullOrWhiteSpace(v) Then Return def Return v.Trim() Catch Return def End Try End Function End Class End Namespacevasantharaidu10 days agoNew Contributor III69Views0likes2CommentsModifying SQL Editor component in Dynamic Dashboards not working
Hi there, I'm working on a client using the version 8.5.2 and I'm trying to use the Dynamic Dashboards functionallity to modify a property from a SQL Editor Component. The purpose of this logic is to set a dashboard in "ReadOnly" mode when the parameter is set, and in this case, the read only mode I want to achieve is by setting "ShowDataManipulationButtons = False". The BR logic used is the following: If Component.DashboardComponentType = DashboardComponentType.SqlTableEditor Then Dim sqlDefinition = XFSqlTableEditorDefinition.ReadXmlString(si,Component.XmlData) sqlDefinition.ShowDataManipulationButtons = False Component.XmlData = sqlDefinition.WriteXmlString(si) End If I have checked that after this point the component XmlData has changed, however, despite returning the modified component, the changes as not being displayed in the dashboard. If instead of modifying an SqlEditor component, I change any property on a Button component, the changes are being displayed correctly. Is this a known issue for the version 8.5.2 or is there any specific thing I might be missing for the SqlEditor component? PD: I know I can achieve creating a copy of the component, but it doesn't makes sense to do something twice (or ten times) when there is a way to solve it dynamically once for all. Thank you in advance!ogonzalez18 days agoNew Contributor II103Views0likes4CommentsHow to Recall Another Business Rule into a Different Business Rule
Hello, Trying to build a business rule to send an email once a button is pressed. The business rule that I'm trying to use is encrypted and I cannot get into it so I was trying to figure out a way to recall that business rule to check if a Lease change status to submitted. I read something about Referenced Assemblies, but I'm not fully sure if that's right or what I even code it as in my current business rule. This is the BR I'm trying to call into my current rule Thanks, WillWillVitale24 days agoContributor II48Views0likes1CommentTransformRuleInfo changes v9.x
Hello, With the new changes to the Stage and Transform tables in v9.x there has been a change to the tables with a new RuleIdentityId identity field and a parallel change to the TransformRuleInfo object. Is there any documentation or best practices for how to use the API to handle this new parameter and ensure adding rules dynamically via BR adheres to the new identity field requirements?drgerrow1 month agoNew Contributor III52Views0likes0CommentsHow to Pull Workflow Certify Comment into BR Email
Hello, I'm trying to pull in the certify comment section when a user clicks on the "Set Certification Status" button. We currently are using the Workflow Event Helper to send the email when the certification is set to In-Process or Certified. Dim oEntityList As List(Of WorkflowProfileEntityInfo) = BRApi.Workflow.Metadata.GetProfileEntities(si, oWorkflowInfo.WfUnitPk.ProfileKey) emailTo = BRApi.Finance.Entity.Text(si, oEntityList(0).EntityMemberID, 8, False, False) emailBody = $"[{si.AppName}] - Status Of {sWFProfileName} WF | {sWFScenario} Scenario For {sMonth} {iYear} was changed To {If(oWorkflowInfo.IsCertified, "Certified", "InProcess")} By {si.UserName}" emailSubject = $"FM Task: {sWFProfileName} Certification Status has been changed to {If(oWorkflowInfo.IsCertified, "Certified", "InProcess")}" FBR_ConnectorLibrary.emailSend(si, emailTo, emailBody, emailSubject, emailBody) Thanks, WillWillVitale1 month agoContributor II32Views0likes0CommentsEvent based Scheduling
Hi, Did anyone implement event-based scheduler through workflow event handler. We have a business rule to extract Chart of Accounts for a Parent Member. This extract needs to be done only after the period close. We need to implement an event-based scheduler where the extract should be done after the period close automatically.PhaniSharma11 month agoNew Contributor63Views0likes2CommentsDynamic Cube Views and Workspaces
Dear community, I was reading the documentation about cube view services, which implies that the dynamic cube views that are accessible by Dynamic Cube View Services need to be in the same workspace. Do you know if this is mandatory to have dynamic cube views in the same workspace (as it seems a like a real issue in production) or is there a workaround to address dynamic cube views that are outside of the assembly's workspace ? Many thanks,Sergey1 month agoOneStream Employee107Views0likes3CommentsI want to Validate that the Data is cleared and validate the calculate
Hi all - We have a Labor Allocation Process that runs manually which we have seen some silent failures occur through our Api Calculate or Api Clear data. I am attempting to go through our business rules and add more complex logging to get a better understanding where/when these things occur. Lets say I had this code block.. Dim sourceDims As String = "U2#None:U3#None:O#Import:I#None:F#None:V#Periodic:C#USD" Dim destinationDims As String = "U2#None:U3#None:O#Import:I#None:F#None:V#Periodic:C#USD" If args.CustomCalculateArgs.FunctionName.XFEqualsIgnoreCase("Copy3rdPartyImportData") Then 'Only run for the Base Entities and local currency If (Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyForEntity()) 'Get the current scenario Name Dim curScenarioName As String = api.Pov.Scenario.Name If curScenarioName = "Rpt_Mar" Then 'Clear previously calculated data api.Data.ClearCalculatedData(True, True, True, True,"A#3PFB_Capital","O#Import","I#None","V#Periodic","C#USD") api.Data.ClearCalculatedData(True, True, True, True,"A#3PFB_Expense","O#Import","I#None","V#Periodic","C#USD") api.Data.ClearCalculatedData(True, True, True, True,"A#Travel_Capital","O#Import","I#None","V#Periodic","C#USD") api.Data.ClearCalculatedData(True, True, True, True,"A#Travel_Expense","O#Import","I#None","V#Periodic","C#USD") 'Seed Current Scenario with previous imported 3rd party data api.Data.Calculate("S#" & curScenarioName & ":A#3PFB_Capital:" & destinationDims & " = RemoveZeros(S#Rpt_Feb:A#3PFB_Capital:" & sourceDims & ")",True) api.Data.Calculate("S#" & curScenarioName & ":A#3PFB_Expense:" & destinationDims & " = RemoveZeros(S#Rpt_Feb:A#3PFB_Expense:" & sourceDims & ")",True) api.Data.Calculate("S#" & curScenarioName & ":A#Travel_Capital:" & destinationDims & " = RemoveZeros(S#Rpt_Feb:A#Travel_Capital:" & sourceDims & ")",True) api.Data.Calculate("S#" & curScenarioName & ":A#Travel_Expense:" & destinationDims & " = RemoveZeros(S#Rpt_Feb:A#Travel_Expense:" & sourceDims & ")",True) I have tried: Dim srcCap As Decimal = api.Data.GetDataCell("S#Rpt_Nov:A#3PFB_Capital:U1#TotUD1:U2#None:U3#None:U4#TotUD4:U5#None:U6#None:U7#None:U8#None:O#Import:I#None:F#None:V#Periodic:C#USD:E#CHN000").CellAmount BRApi.ErrorLog.LogMessage(si, "SOURCE 3PFB_Capital=" & srcCap.ToString("N2")) Which results in 0. api.Data.Calculate(formula1, True) Dim verify1 As Decimal = api.Data.GetDataCell("S#Rpt_Dec:A#3PFB_Capital:U1#TotUD1:U2#None:U3#None:U4#TotUD4:...E#" & api.Pov.Entity.Name).CellAmount BRApi.ErrorLog.LogMessage(si, "DEST read-back=" & verify1.ToString("N2")) same with something like this.Design Approach for Actual and Budget Consolidation Using FSK
Hi OS Community, I’m an EPM Consultant working mainly on Financial Consolidation, and I would appreciate some guidance on a scenario‑specific consolidation design question. Currently, our Actuals consolidation process is working correctly and uses the standard XFW_FSK_Accounts lookup table to drive account mapping during consolidation. This includes full account‑level detail, which is required for statutory reporting and analysis. Now we need to enable consolidation for the Budget scenario, the rules for Budget should be the same as Actual , but with a different level of granularity: The Budget scenario is loaded at a higher‑level Account hierarchy Main Question What is the recommended way to use a different account mapping lookup table for Budget while keeping the existing XFW_FSK_Accounts logic for Actuals? More specifically: Can we assign or reference a different account lookup table (e.g. XFW_FSK_Accounts_Budget) within the consolidation Business Rules, based on the Scenario? Is it best practice to: Use Scenario‑driven logic inside the consolidation BRs to switch lookup tables? Or create separate consolidation rules for Actual vs Budget? Are there any framework‑supported patterns for handling multi‑scenario account mappings where hierarchies differ? If anyone has implemented a similar approach or can point to best practices / documentation, your insights would be greatly appreciated. Thanks in advance for your help! Best regards, CarolinaCarolina_mgm1 month agoNew Contributor67Views2likes0CommentsOrders calculation formula using Backlog and Sales Accounts
Hello, I'm attempting to create an orders (500055) account, calculated using existing Backlog (500054) and Sales (100020) Accounts. (Current Month Backlog - Prior Month Backlog + Current Month Sales) When I run this calculation in the forecast scenario, February - December work as expected, but there is an issue with January that I can't pinpoint. Any ideas where I've gone wrong? Thank you in advance, Justin Trad If ((Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyForEntity)) And api.Time.GetPeriodNumFromId(api.Pov.Time.MemberID) = 1 Then api.data.calculate("A#500055:T#PovYearM1:O#import:U1#none:U2#none:U5#none:U6#none = (A#500054:T#PovYearM1:O#top:U1#top:U2#top:U5#top:U6#top - A#500054:T#PovPriorYearM12:O#top:U1#top:U2#top:U5#top:U6#top) + A#100020:T#PovYearM1:O#top:U1#top:U2#top:U5#top:U6#top") Else If ((Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyForEntity)) Then api.data.calculate("A#500055:T#Pov:O#import:U1#none:U2#none:U5#none:U6#none = (A#500054:T#Pov:O#top:U1#top:U2#top:U5#top:U6#top - A#500054:T#PovPrior1:O#top:U1#top:U2#top:U5#top:U6#top) + A#100020:T#Pov:O#top:U1#top:U2#top:U5#top:U6#top") End IfJustin_Zurn1 month agoNew Contributor99Views0likes2Comments
Tags
- Finance487 Topics
- Extenders281 Topics
- Admin191 Topics
- dashboards152 Topics
- XFBR126 Topics
- System90 Topics
- cubeview82 Topics
- Connectors72 Topics
- Parsing60 Topics
- Spreadsheet35 Topics