Entity Relationship Properties update via business rules
Hi Team, I would like to fetch and update the Entity Relationship Properties for the Entity Dimension members via Business Rules. The below peace of code works fine for only when I pass the Actual and Budget but when i pass the other scenario Type like Scenariotype 1 to 8 I get the error Object is not set to an instance of an object. Dim Scenario As String = args.CustSubstVarsAlreadyResolved("Param_SecnarioType_EO_24") 'The above value i get it from the combo box as delimited list Dim Scenarioid As Integer = BRApi.Finance.Members.GetMemberId(si,dimtype.Scenario.Id,Scenario) Dim MyScenarioTypeid As ScenarioType = BRApi.Finance.Scenario.GetScenarioType(si,Scenarioid) Dim Timefilter As String = args.CustSubstVarsAlreadyResolved("Param_Time_24") Dim Timeid As Integer = BRApi.Finance.Members.GetMemberId(si,dimtype.Time.Id,Timefilter) Can you please help me with the correct way to get the scenario Type.45Views0likes0CommentsData source Connector - Nested Drill back
Hi, I am trying to build a Drill back functionality in one of data source connector business rules. I tried looking into One Stream reference guide on Data Source connector business rules and I found below reference for nested Drill back functionality. But practically when I tried to drill back on a drill back detail row, OS returns following message. The click on the drill back is not even calling the connector business rules any more. Can someone help me with the ways to code with nested drill backs. I tried to follow the examples from Golfstream application. Private Function GetDrillBackTypeList(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Transformer, ByVal args As ConnectorArgs) As List(Of DrillBackTypeInfo) Try 'Create the SQL Statement Dim drillTypes As New List(Of DrillBackTypeInfo) If args.DrillCode.Equals(StageConstants.TransformationGeneral.DrillCodeDefaultValue, StringComparison.InvariantCultureIgnoreCase) Then 'Source GL Drill Down drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.FileShareFile, New NameAndDesc("InvoiceDocument", "Invoice Document"))) drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.DataGrid, New NameAndDesc("MaterialTypeDetail", "Material Type Detail"))) ElseIf args.DrillCode.Equals("BOMDetail", StringComparison.InvariantCultureIgnoreCase) Then 'Material Type Drill Down drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.DataGrid, New NameAndDesc("MaterialAllProducts", "Material All Products"))) drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.DataGrid, New NameAndDesc("MaterialAllVendors", "Material All Vendors"))) End If Return drillTypes Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function 'Execute specific drill back type Private Function GetDrillBack(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Transformer, ByVal args As ConnectorArgs, ByVal connectionString As String) As DrillBackResultInfo Try If args.DrillBackType.NameAndDescription.Name.Equals("InvoiceDocument", StringComparison.InvariantCultureIgnoreCase) Then 'Level 1: Show FileShare File Dim drillBackInfo As New DrillBackResultInfo drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.FileShareFile drillBackInfo.DocumentPath = Me.GetDrillBackDocPath_L1(si, globals, api, args) Return drillBackInfo ElseIf args.DrillBackType.NameAndDescription.Name.Equals("MaterialTypeDetail", StringComparison.InvariantCultureIgnoreCase) Then 'Level 1: Return Drill Back Detail Dim drillBackSQL As String = GetDrillBackSQL_L1(si, globals, api, args) Dim drillBackInfo As New DrillBackResultInfo drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.DataGrid drillBackInfo.DataTable = api.Parser.GetXFDataTableForSQLQuery(si, DbProviderType.OLEDB, connectionString, True, drillBackSQL, False, args.PageSize, args.PageNumber) Return drillBackInfo ElseIf args.DrillBackType.NameAndDescription.Name.Equals("MaterialAllProducts", StringComparison.InvariantCultureIgnoreCase) Then 'Level 1: Return Drill Back Detail Dim drillBackSQL As String = GetDrillBackSQL_L2(si, globals, api, args, True, False) Dim drillBackInfo As New DrillBackResultInfo drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.DataGrid drillBackInfo.DataTable = api.Parser.GetXFDataTableForSQLQuery(si, DbProviderType.OLEDB, connectionString, True, drillBackSQL, False, args.PageSize, args.PageNumber) Return drillBackInfo ElseIf args.DrillBackType.NameAndDescription.Name.Equals("MaterialAllVendors", StringComparison.InvariantCultureIgnoreCase) Then 'Level 1: Return Drill Back Detail Dim drillBackSQL As String = GetDrillBackSQL_L2(si, globals, api, args, False, True) Dim drillBackInfo As New DrillBackResultInfo drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.DataGrid drillBackInfo.DataTable = api.Parser.GetXFDataTableForSQLQuery(si, DbProviderType.OLEDB, connectionString, True, drillBackSQL, False, args.PageSize, args.PageNumber) Return drillBackInfo Else Return Nothing End If Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function Thanks, Mohan Alluri.Solved4.5KViews0likes12CommentsDimension members loading process using SIC
Hi all, I'm quite new to OS integration pieces and being struglled with a request from my client to load dimension members using their data lake, so the memebers would be updated automatically or by a scheduled event. The database is already configured at SIC and working fantastically well, however, I can't figure how to use it's features to load the metadata members to one of our UD dimensions. I read a lot of topics here in the forum, but couldn't find anything that matches my case. I already tried to create a Extender BR, but I'm getting a "Object variable or With block variable not set" error message when running the "api.Parser.ProcessSQLQuery" function. Not sure if I'm doing something extremely wrong, so I"m assuming that this part of the api must be used only within Connector BR's. I also trie to create a connector rule to do the job, but when setting it up at the dimension property, nothing happened (not sure if I missed something here). Any help on this will be really appreciated! Regards100Views0likes1CommentWhere does Stored Calculations store Data?
Today, a customer asked me:Where do stored calculations store data? api.Data.Calculate If Statements In stored calculations, If Statements are helpful to specify that a formula is only required to execute on specific Data Units, as shown in the image below. If ((Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyForEntity()))contains two logical operators (AndandNot). Due to theANDoperator, the statement api.Data.Calculate("S#Forecast = S#Actual") betweenThenandEnd Ifwill only run if both of the following are true: The Entity is a Base-level Entity Member, i.e.: doesNOThave Children (Not api.Entity.HasChildren()) The Consolidation Member is Local indicating the Entity Member's local currency (api.Cons.IsLocalCurrencyForEntity()) The statementapi.Data.Calculate("S#Forecast = S#Actual")will copy the S#Actual data buffer to the S#Forecast data buffer. TheIf...End Ifis limiting the calculation statement to execute only for specific Data Unit Dimension Members. Other consideration to take into account when creating store calculation rules.💥 api.Data.Calculate("A#CashCalc=RemoveZeros(A#10000)")uses the RemoveZeros function to remove cells with No Data or 0.00 cells in the A#10000 data buffer. The results are stored in the A#CashCalc data buffer. The RemoveZeros function is to help with performance if there are large amounts of No Data or 0.00 cells. END IF😂😀😃84Views0likes0CommentsOneStream Connector Business Rule
Hi, I am trying to establish a connection between OneStream and my local SQL server but getting below error. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (SQL Error Number -2146232060, -1)466Views0likes12CommentsHelper Classes
I feel like an idiot asking this question but I can't find anything on google. Where do all of the 'Helper' classes come from? TimeDimHelper,StringHelper,ApplicationZipFileHelper,ScenarioDimHelper Are these all OneStream specific? Is there any documentation or good posts about their use? Thanks, ScottSolved1.2KViews1like4CommentsI Would like to print the Parent Dimension Member in error log
Hi All, I need some assistance in printing the to dimensionally get the parent name of the Child member. Code populating the base member into the table is completed without any error. Can someone please help. ThanksSolved373Views0likes3Commentsdocumentation: file having all functions syntax/ library/ libraries
Dear all, Is there any file containing the detail/syntax of the functions? I'm thinking for instance in an XML file or something similar. This is a similar question already posted, but I'd like to know if there's an update. Solved: documentation/list of functions in OneStream Namespaces/Libraries - OneStream Community (onestreamsoftware.com) Thank you in advance. Carlos446Views0likes3CommentsError trying to read a file from a local fileshare using SIC
Hello, I'm tying to read files from an azure fileshare mount as a disc unit in the same server where SIC is installed. I guess this has to works as a disc unit C:/ butthe business rule throws an execution error Could not find a part of the path 'z:\\Temp\\zw_2023.csv'. this is part of the code that I'm using Public Sub CleanupData(ByVal si As SessionInfo) Dim objRemoteRequestResultDto As RemoteRequestResultDto = BRApi.Utilities.ExecRemoteGatewayBusinessRule(si, "TestFile", Nothing, "remote_test", "DeleteOldFileData") If (objRemoteRequestResultDto.RemoteResultStatus = RemoteMessageResultType.RunOperationReturnObject) Then Dim result As Boolean result = objRemoteRequestResultDto.ObjectResultValue Dim objRemoteRequestResultDtoCached As RemoteRequestResultDto = BRApi.Utilities.ExecRemoteGatewayCachedBusinessRule(si, "TestFile", Nothing, "remote_test", 90) BRApi.ErrorLog.LogMessage(si, "File Deleted: " & result) Else If (Not (objRemoteRequestResultDto.remoteException Is Nothing)) Then Throw ErrorHandler.LogWrite(si, New XFException(si,objRemoteRequestResultDto.remoteException)) End If End If End Sub For the remote BR public bool DeleteOldFileData() { string fname = @"z:\Temp\hw_2023.csv"; try { System.IO.File.Delete(fname); return true; } catch (IOException) { return false; } }236Views0likes1CommentSmart Integration Cloud (SIC) gateway to update / delete / truncate / insert into local tables
Hello, I'm having a lot of difficulties in trying to connect to my local gateway to execute a business rule that would insert values from a datatable into a local sql table. The examples providing in the documentation look incomplete or contain errors. My gateway is called : abc_gateway and redirect to my local machine which is online I have a custom database server connection which is redirected towards my local machine 'abc_local' My business rule that will invoke the BR on my local machine (this business rule currently sits in a workspace assembly) : Dim GatewayName As String = "abc_gateway" ' Name of the Gateway Dim SICFunctionName As String = "SIC_Functions" ' Name of the SIC Function to run Dim RemoteMethodName As String = "RunOperation" ' Name of the method inside the SIC Function that will be called. Dim resultdatatable = BRApi.Utilities.ExecRemoteGatewayBusinessRule(si, SICFunctionName, Nothing, GatewayName, RemoteMethodName) Then I have a smart integration function in business rule : Imports System Imports System.Collections.Generic Imports System.Data Imports System.Data.Common Imports System.Globalization Imports System.IO Imports System.Linq Imports System.Data.SqlClient Imports OneStreamGatewayService Namespace OneStream.BusinessRule.SmartIntegrationFunction.SIC_Functions Public Class MainClass Public Function RunOperation() As DataTable Dim datatableresults = New DataTable() Dim connectionString As String = APILibrary.GetRemoteDataSourceConnection("MyTests") '<-- my local sql database Using Connection = New SqlConnection(connectionString) connection.open() Dim sql As String = "select * from test" '<-- query to the test sql table of my local sql datatabase Dim cmd As SqlCommand = New SqlCommand(sql, connection) Dim dbreader = cmd.ExecuteReader() dataTableResults.Load(dbreader) Return dataTableResults End Using End Function End Class End Namespace This is my local SQL database and my local sql table. I can indeed connect to it in a data adapter but can't seem to execute a remote business rule : I just constantly keep the message : "The ConnectionString property has not been initialized." I tried changing theAPILibrary.GetRemoteDataSourceConnection to either the custom database connexion name, the gateway name ... but can't work this out. Regards,229Views0likes0Comments