Finding a user connection type in Business Rules
Hello, We are trying to find the best way to determine if a user is using web-based or Windows App OneStream environments to customize a dashboard experience. For now, we are using the si.WebServerURLByClient to determine this which works but seems a bit clunky. Is there a better call to determine which environment a user is in? Thanks in advance. BrettSolved23Views0likes2CommentsTransformationEventHandler - Adding new member to main and Alternate hierarchy
Is it possible to add members to both main and alternate hierarchies using EventHandler from source. Was not able to achieve using existing code. Below code is being used to add new members from source to the Flow dimension which works for main hierarchy but not adding under Alternate hierarchy, any help is appreciated. The new member needs to get added under both parents below Dim flowDimName As String = "Product_Attributes" Dim flowMF As String = "F#TopProductAttributes.Base" Dim flowLookup As Dictionary(Of String, MemberInfo) = Me.CreateMemberLookupUsingFilter(si, flowDimName, flowMF) Dim ExistflowLookup As List(Of MemberInfo) = BRApi.Finance.Metadata.GetMembersUsingFilter(si, flowDimName, flowMF, True) Dim flowAddedMembers As New Dictionary (Of String, String) 'Set the parent to add new FLOW Members under Dim tFlowColIndex As Integer = (objTransformer.TransformerDimensions(StageConstants.MasterDimensionNames.Flow).DataTableColumnIndex) + StageConstants.TransformationColumnIncrements.Target '****************Start adding new members********************************************* 'Loop over all pages in the cache If objTransformer.DataCache.Pages.Count > 0 Then 'Move to the first page objTransformer.DataCache.MoveFirstPage(si) 'BRAPI.ErrorLog.LogMessage(si,"Add member Yes: Line 223") 'Process All pages in the data cache For intPageNo As Integer = 0 To objTransformer.DataCache.Pages.Count - 1 'Set the current data page objTransformer.DataCache.ActivatePage(si, intPageNo) 'Process each row in the data table on this page for each dimension we are checking For Each row As DataRow In objTransformer.DataCache.CurrentPage.PageDataTable.Rows ' BRApi.ErrorLog.LogMessage(si, "Line 123") 'Check the target Flow Value Dim targetFlow As String = row(tFlowColIndex) Dim flowDesc As String = "" '*** Product Attribute Description *** Dim flowMember As String = row(tFlowColIndex) 'Determine Flow Parent member Dim flowParent As String = "NA_RELEASE_STATUS" 'Determine Flow Parent member Dim flowParent As String = "NA_RELEASE_STATUS" If (Not row(tFlowColIndex) Is Nothing) Then If flowMember.XFContainsIgnoreCase("NOT_RELEASED~AUTOMOTIVE") Or flowMember.XFContainsIgnoreCase("NOTRELEASED~AUTOMOTIVE") Then flowParent = "NOT_RELEASED" ElseIF flowMember.XFContainsIgnoreCase("NOT_RELEASED~AUTOMOTIVE") Or flowMember.XFContainsIgnoreCase("NOT_RELEASED~AUTOMOTIVE") Then flowParent = "AUTOMOTIVE" End If End If19Views0likes0CommentsUnable to set the CreditAmount in JournalLineItem for journals created with Business Rule
I can't seem to figure out why the CreditAmount in the JournalLineItem isn't reflecting the number that I assign to it. It's always zero no matter what. Is anyone experiencing this issue? see my code below. Sub CreateJournal(ByVal si As SessionInfo) Try 'Set up a new journal header. Dim journalObjectHeader As New JournalHeader() With journalObjectHeader .Name = "Test_Journal" .Description = "This is a test journal" .WorkflowProfileID = si.WorkflowClusterPk.ProfileKey .MemberIds.Scenario = si.WorkflowClusterPk.ScenarioKey .MemberIds.Time = si.WorkflowClusterPk.TimeKey .JournalStatus = JournalStatus.Working .IsSingleEntity = False End With Dim journalObjectLineItems As New List(Of JournalLineItem) 'Create the first journal line item Dim jnLineItem1 As New JournalLineItem With jnLineItem1 .EntityId = BRApi.Finance.Members.GetMemberId(si, DimType.Entity.Id, "100_US") .AccountId = BRApi.Finance.Members.GetMemberId(si, DimType.Account.Id, "10220030") .FlowId = BRApi.Finance.Members.GetMemberId(si,DimType.Flow.Id, "EndBal") .ICId= BRApi.Finance.Members.GetMemberId(si, DimType.IC.Id, "None") .DebitAmount.Amount = 150 End With journalObjectLineItems.Add(jnLineItem1) 'Create the 2nd journal line item Dim jnLineItem2 As New JournalLineItem With jnLineItem2 .EntityId = BRApi.Finance.Members.GetMemberId(si, DimType.Entity.Id, "100_US") .AccountId = BRApi.Finance.Members.GetMemberId(si, DimType.Account.Id, "10220050") .FlowId = BRApi.Finance.Members.GetMemberId(si,DimType.Flow.Id, "EndBal") .ICId= BRApi.Finance.Members.GetMemberId(si, DimType.IC.Id, "None") .CreditAmount.Amount = - 150 End With journalObjectLineItems.Add(jnLineItem2) 'Create a new journal object Dim journalObject As New Journal(journalObjectHeader, journalObjectLineItems) 'Save it BRApi.Journals.Metadata.SaveJournalOrTemplateUsingIds(si, journalObject,False, True) Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End SubSolved19Views0likes1CommentUse Data Adapter in a Different Workspace
I'm looking copy an existing data adapter (screenshot below) from the RCM solution into a different workspace and use it within BI Viewer for custom dashboards. I believe the 'GetReconsWithStatusGridView' function is stored within the 'Services' assembly folder and 'ReconService.cs' is the file within the folder that needs called. I have 'Is Shareable Workspace' set to True. Since the method query references WSMU, I need to update that in order to properly call the underlying business rule. That's the part I'm having trouble with. I've tried a wide variety of syntax to no avail. Examples: {Workspace.OFC.RCM}{GetReconsWithStatusGridView}{AccountFilter=...} {Workspace.OFC.RCM.Services}{GetReconsWithStatusGridView}{AccountFilter=...} {Workspace.OFC.RCM.Services.ReconService}{GetReconsWithStatusGridView}{AccountFilter=...} Does anyone know the proper syntax to place in my copied data adapter? Are there any other steps I need to take to properly reference this business rule? Thanks!33Views0likes0CommentsFDX filter not working
I am trying to extract cube data using FdxExecuteDataUnit however, the filter does not seem to be filtering any data. Any ideas what the issue could be? I am seeing multiple flow members in the data table. Is there also a way to do all base members for a dimension? Dim dt As DataTable Dim cbName As String = "FinConsol" Dim ent As String = "E#124" Dim cons As String = "C#Local" Dim scen As String = "S#Actual" Dim time As String = "T#2025M1" Dim view As String = "V#YTD" Dim filter As String = "Origin='Import' AND Flow='EndBalInp' AND Account = 'NetInc' AND UD7 = 'GL_Load'" dt = BRApi.Import.Data.FdxExecuteDataUnit(si, cbName, ent, cons, ScenarioTypeId.Actual, scen, time, view, True, filter, 1, False)24Views0likes2CommentsCall Assembly Business Rule from another Workspace in a Data Management Step
I'm looking to call a business rule that is located in a different workspace within Assemblies but am unsuccessful. The first screenshot below shows my DM step configuration. The business rule I'm trying to call is an out-of-the-box rule within the Financial Close solution. The second screenshot shows the workspace (namespace prefix = OFC), the assembly (RCM) and the business rule (DiscoverRecons). The third screenshot shows the tool tip when you hover over "Business Rules" on the DM step. I've attempted many variations of the yellow highlighted syntax, always returning an invalid business rule error. The fourth screenshot shows the out-of-the-box DM step I'm emulating. I used this to verify the parameters I'm passing in work which they do. I've ensured that both the current workspace and OFC workspaces are sharable and include the shared workspace names. Does anyone know the correct syntax to call this rule into my DM step?109Views0likes7CommentsReturning a success or failure message from DM via REST API
Hi all, I'm triggering a DM job using the REST API. The job is running a business rule. I handle errors in the BR but I need to actually return the success or failure as a response to the postman request. Right now, I get a success message no matter what happens in the BR. Thanks in advance!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.23Views0likes1CommentBusiness Rule to Remove Base-Level Entities from a Parent Rollup Based on Keyword Match
Hi everyone, I'm working on a Business Rule in OneStream and could use some guidance. I’m trying to build a rule that targets a user-defined parent rollup within the Entity Dimension. The goal is to automatically remove the relationship between that rollup and any base-level child entities whose name or description contains a specific keyword — in this case, "YS". Here’s what I’m aiming for: The rule should accept a parent rollup name (e.g., Global_excl_YS) It should loop through all children of that rollup If a child is a base member and its name or description includes "YS", the rule should "remove the relationship" Parent or intermediate rollups should remain untouched I’m planning to implement this as an Extensibility Business Rule, but I’d love to hear if anyone has done something similar or has tips on best practices for metadata manipulation in this context. Thanks in advance! ' Define dimension and parent rollup as parameters or hardcode here Dim EntityDimPK As DimPk = BRApi.Finance.Dim.GetDimPk(si, "MgmtEntity") Dim RollupName As String = "Global_excl_YS" Dim RollupMember As Member = BRApi.Finance.Members.GetMember(si, dimtype.Entity.Id, RollupName) ' Get all direct children of the rollup Dim Children As List(Of Member) = BRApi.Finance.Members.GetChildren(si, EntityDimPK, RollupMember.MemberId, Nothing) Dim RemovedEntities As New List(Of String) For Each ChildMember As Member In Children Dim ChildName As String = ChildMember.Name Dim ChildDesc As String = If(ChildMember.Description, "") ' Check if base (no children) Dim HasChildren As Boolean = BRApi.Finance.Members.HasChildren(si, EntityDimPK, ChildMember.MemberId, Nothing) If Not HasChildren Then ' Check if "YS" in name or description If ChildName.ToUpper().Contains("YS") Or ChildDesc.ToUpper().Contains("YS") Then ' Remove Relationship End If End If Next If RemovedEntities.Count = 0 Then Return "No base children with 'YS' found under " & RollupName Else Return "Removed from " & RollupName & ": " & String.Join(", ", RemovedEntities) End If26Views0likes1Comment