What IMPORT should i use for the SECURITY updates for BRApi
Hi All, i am new to OneStream, i tried creating BR for Security automation. below is my entire code in OS-BR. 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.BR_UserManagement Public Class SecurityGroupHelper Public Sub ShowQAGroups(ByVal si As SessionInfo, ByVal api As FinanceRulesApi) Try ' Get all security groups using the API passed to the function Dim allGroups As GroupInfo = BRApi.Security.Admin.GetGroup(si, "QA_Admin") ' Loop through all groups and display a MessageBox for each that starts with "QA_" For Each grp As MemberInfo In allGroups If grp.Member.Name.StartsWith("QA_") Then MessageBox.Show(grp.Member.Name, "QA Group Found") End If Next Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Sub End Class End Namespace --------------------------------------------------------------------------------------- I am getting error as below. i am not sure what mistake in the code. one i am sure about messagebox.show. Error compiling Business Rule 'BR_UserManagement'. 1) Error at line 27: Expression is of type 'GroupInfo', which is not a collection type. 2) Error at line 29: 'MessageBox' is not declared. It may be inaccessible due to its protection level.66Views0likes5CommentsHow to export data out of BR
Hi All, I created a Business Rule to export all the GROUPS that i have in OS applciation. i try to export the data in a file. i tried below option , it did not work created BR and executed there as File output Created a Data Management Sequence and added 2 steps. 2 for BR and other for File Export. But my File export fails as NAME Empty Below is the error Error processing Data Management Step 'ExportGroups'. Name is empty. Below is the BR i used. 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.Extender.BRGetAllGroups_1 Public Class MainClass Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object Try ' Get all security groups Dim groupsObj As Object = BRApi.Security.Admin.GetGroups(si) Dim names As New List(Of String) If groupsObj Is Nothing Then names.Add("No security groups found") Else Dim enumerable = TryCast(groupsObj, System.Collections.IEnumerable) If enumerable IsNot Nothing Then For Each g In enumerable If g IsNot Nothing Then Dim name As String = g.ToString() If name <> "" AndAlso Not names.Contains(name) Then names.Add(name) End If End If Next End If End If ' FORMATTED OUTPUT FOR EASY VIEWING Dim output As New List(Of String) output.Add("=== SECURITY GROUPS LIST ===") output.Add("Generated: " & DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")) output.Add("") For Each name In names output.Add(name) Next output.Add("") output.Add("=== END OF LIST ===") output.Add("Total groups: " & names.Count.ToString()) Return output Catch ex As Exception Dim errorList As New List(Of String) errorList.Add("ERROR: " & ex.Message) errorList.Add("Generated: " & DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")) errorList.Add("=== END ===") Return errorList End Try End Function End Class End NamespaceSolved60Views0likes3Commentsaccount is not translating
Good afternoon, I need help with translating a balance account. We set it up to calculate job to date and load its local currency value, then I wanted to translate it using a job to date rate (also setup as the balance account). The formula attached to the account is for every foreign base entity executes this: api.Data.Calculate("A#JTD_COST:V#YTD:F#EndBalLoad:U8#None:C#USD = RemoveZeros(A#JTD_COST:V#YTD:F#EndBalLoad:U8#None:C#Local * A#JTD_FX_RATE:V#YTD:F#EndBalLoad:U8#None:C#Local)",,,,,"U1#Active.base") The problem is that when I set the original account with Formula Pass then I get an error during the consolidation suggesting the invalid destination data unit in script. When I don't attach any Formula Pass then nothing happens at all. Any suggestions what I miss or how else balance accounts can be translated? Thank you, Ola104Views0likes4CommentsUse 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!47Views0likes0CommentsShow Plug Account property for an Account on UD
The below code returns the Plug Account name for an Account, taken from the Plug Account property on the Account It is a DynamicCalc on UD8. Set up a U8 member, f.ex. "YourName" Api.Account.GetPlugAccount returns a long string that contains the Plug Account Name For each Account that has a Plug Account, the string will contain "DimId: 22", so this can be used as filter. The Plug Account name will be stated directly after "Name: ", so this can be extracted from the string. In the below example, "NA" is returned where there is no Plug Account. The Plug Account Name will be shown when using V#Annotation:U8#YourName on Accounts ---------------------------------------------- Dim AccPlugAccName As String = "" ' Fetch the Plug Account property Dim fetchedValue As String = Api.Account.GetPlugAccount(Api.Pov.Account.MemberId)?.ToString() ' Check if the fetched string is not null/empty and contains "DimId: 22" If Not String.IsNullOrEmpty(fetchedValue) AndAlso fetchedValue.Contains("DimId: 22") Then ' Extract only the value after "Name: " and before the next comma Dim startIndex As Integer = fetchedValue.IndexOf("Name: ") + "Name: ".Length Dim endIndex As Integer = fetchedValue.IndexOf(",", startIndex) AccPlugAccName = fetchedValue.Substring(startIndex, endIndex - startIndex).Trim() Else ' Assign "NA" if the condition is not met AccPlugAccName = "NA" End If ' Return the result Return AccPlugAccName26Views0likes0Commentshelp with a conditional statement
Hello, I wrote a simple formula for Wip Rev that checks the amount in Earned Revenue (that is calculated too) and calculates the difference between its current value(POV) and prior year end value(POVPriorYearM12) - this part worked, but then I added a conditional statement saying that if Earned Revenue is zero then Wip Rev should be zero too else run the math (POV - POVPriorYearM12) and only first part works, but math doesn't. I tried a similar statement for the dynamic calc and I was successful, but here no. Please let me know if you can look at the statement and suggests what is wrong... thank you112Views0likes8CommentsHow to call a workspace assembly service from another workspace assembly service ?
Dear community, One of my use case is to create a function that I would commonly use in any other workspace. I haven't seen a community message about it, and the documentations does not specify how to do so, so here's the use case : I have a Workspace A (name: WorkspaceA), with an assembly named WA_Assembly, and in it are my services & functions that I want to reference and use. I have a Workspace B, where I need to call the functions from Workspace A. SOLUTION : Create a new dependency in Workspace B : Dependency Type : "Workspace Assembly" Shared Workspace Name : WorkspaceA Dependency Name : WA_Assembly Then, in a given Workspace B service, use Imports Workspace.WorkspaceA.WA_Assembly (vb.net) or using Workspace.WorkspaceA.WA_Assembly (C#) for referencing the Shared Public Functions. Then you will be able to use these functions in another workspace ! Just adding this message for future references :)77Views2likes1CommentMove File from Application Database to External Shared Drive
I currently have a metadata file being created by an Extender BR and saved down to the Application Database: Case Is = ExtenderFunctionType.ExecuteDataMgmtBusinessRuleStep 'Export File Dim fileName As String = "AccessoryMetadata.csv" Dim filePath As String = $"Documents/Public/XFDocs/XFDocs_Public" Dim ud1DimPk As DimPk = BRApi.Finance.Dim.GetDimPk(si, "MainProduct") Dim category As String = "" Dim businessStream As String = "" 'Export CSV to User Temp Folder Dim listOfParents As List(Of memberinfo) = BRApi.Finance.Members.GetMembersUsingFilter(si, _ ud1DimPk, _ "U1#ReportingProduct.Descendants.Where(" & _ "Name Contains Accessories" & _ "And Name <> 15_Accessories" & _ "And HasChildren = True)", _ True) Dim csv As New Text.StringBuilder csv.AppendLine("Name, Description, ParentName, Category, Business Stream") For Each parentMember In listOfParents For Each childMember In BRApi.Finance.Members.GetChildren(si, _ ud1DimPk, parentMember.Member.MemberId) ... csv.AppendLine($"""{childMember.Name}"",""{childMember.Description _ }"",""{parentMember.Member.Name}"",""{category}"",""{businessStream}""") Next Next Dim fileBytes As Byte() = Encoding.UTF8.GetBytes(csv.ToString) 'Save csv to file Dim XFfileDataInfo As New XFFileInfo(FileSystemLocation.ApplicationDatabase, fileName, filePath) Dim XFfileData As New XFFile(XFFileDataInfo, String.Empty, fileBytes) brapi.FileSystem.InsertOrUpdateFile(si, XFfileData) Is there any way to then automatically move this file to an external shared drive? Or does the above need to be written in a different way in order for it to work?Solved4.3KViews0likes6Comments