BR Rule - BR api Error log
Hello All, OS experts - Greetings ! I am trying to complete the following code to extract the year and month from a given date. To help with validation and debugging, I've enabled BRAPI.ErrorLog.LogMessage to display the variable outputs in the error log. However, for some reason, it is not displaying any values in the error log. I would greatly appreciate any insights into what might be wrong with the code. Here is the code I am working with: Dim vDate As String = args.NameValuePairs.XFGetValue("Date") ' e.g., "01/01/2025" (MM/DD/YYYY format) ' Log the retrieved Date for debugging BRAPI.ErrorLog.LogMessage(si, "vDate: " & vDate) ' Ensure vDate is not null or empty before proceeding If Not String.IsNullOrEmpty(vDate) Then ' Extract the year (last 4 characters) from vDate and convert to an integer Dim vYear As Integer = CInt(vDate.Substring(6, 4)) BRAPI.ErrorLog.LogMessage(si, "vYear: " & vYear) ' Extract the month (first 2 characters) from vDate and convert to an integer Dim vMonth As Integer = CInt(vDate.Substring(0, 2)) BRAPI.ErrorLog.LogMessage(si, "vMonth: " & vMonth) Else BRAPI.ErrorLog.LogMessage(si, "vDate is null or empty!") End If Thank you in advance.35Views0likes8CommentsBusiness Rules for new OS implementation
Hi, we are implementing OS at present, and this is our first-ever project in OneStream; I need guidance on Business Rules. I am not sure what business rules we need to consider after and before we import the data from the Client system to match the client's legacy system data with OneStream numbers. Thanks, Preeti37Views0likes2CommentsRetrieve Annotation Data and send to XFBR
Hi All, Let's say we have a table: Fruits (Annotation) Updated Fruit Value (annotation) Price of Fruit (input numerical value) apple banana $1.99 banana kiwi $2.99 strawberry melon $3.99 Let's say the fruits column is a UD dimension member and the Updated Fruit value contains a combo box in the cell where a user can update whatever value that shows in column 1. Meaning if in column 2 it says banana then the selection in that column overrides the apple (by override I mean that the price in the last column will map the numerical value to banana instead of apple for that intersection). Is there a way to retrieve annotation values on the backend and send to an XFBR (Ideally sending to an XFBR so I can assign that member to my pov for my Price of Fruit column)?19Views0likes1Commentperformance issue.
Hello OneStream Community, I am working with a Cube View where I need to display the Income Statement data for the end of every year (December). The data should show up as the beginning balance for the January month in the subsequent year. To achieve this, I used a Row Override1 member filter with the formula T#povprioryearm12. The Cube View includes four dimensions: Entity, Division, Cost Center, and Accounts. However, I am experiencing slow loading times when the view is being accessed. it is not exporting to Excel to validate. I would like to know if there are any best practices or strategies for improving the performance of the Cube View in this scenario. Are there specific optimizations I should consider for the member filter, the dimensions, or the Cube View configuration to reduce loading times? Any advice or recommendations would be greatly appreciated! Thank you in advance!18Views0likes1CommentBusiness Rules Implementation
Hi, I'm trying to learn more about the business Rules and what they are doing. Where can I find the various function implementations. For Example: I have this function Dim connectionString As String = GetConnectionString(si, globals, api) For the GetConnectionString function where is the code for this funciton ? so I can read and understand what its doing ? If this is in the API, I have been looking there today, can you reference which folder / document I can get this. Thanks for your help in advance.57Views1like1CommentUsing Conditional Input to Suppress CV Columns
Hi All, As the name states above I'm trying to dynamically modify suppression settings on a column in a CV based on a value selected in a parameter. So for example let's say if a user selects an option from a parameter I want to modify suppression settings on certain columns based on that selection choice. I have two questions: Is there a way to do this? If there is a way, how would this business rule/function be passed? In the CV? In the Cube? Thank You...Any assistance on this would be extremely helpful.Solved32Views0likes2CommentsError in Business Rule for Data Mgmt Process
Data Mgmt sequence and steps work great when utilizing a 'manual' initiation of this process and business rule. However, the DM process automatically initiates twice daily at specific times using the same code and rules. When this occurs, it fails on occasion (not always), and this error message is received: Summary: Error processing Data Management Step 'ProcessRecons_RCM'. Unable to execute Business Rule 'RCM_DataMgmtProcess'. One or more errors occurred. () Concurrency violation: the UpdateCommand affected 0 of the expected 1 records. This is the business rule in use... asking if anyone can spot an obvious issue I have overlooked or might know the cause of the failed task on occasion. Business Rule: Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object Try Select Case args.FunctionType Case Is = ExtenderFunctionType.ExecuteDataMgmtBusinessRuleStep 'Prepare Parameters Dim wfProfile As String = args.NameValuePairs.XFGetValue("WFProfile", String.Empty) Dim wfTime As String = args.NameValuePairs.XFGetValue("WFTime", String.Empty) 'Load Substitution Variables To Parse WFProfile and WFTime Using dbConnFW As DbConnInfo = BRApi.Database.CreateFrameworkDbConnInfo(si) Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si) Dim subVarInfo As SubstVarSourceInfo = SubstitutionVariablesHelper.CreateSubstVarSourceInfo(dbConnFW, dbConnApp, False) wfProfile = SubstitutionVariableParser.ConvertString(si, subVarInfo, Nothing, wfProfile) wfTime = SubstitutionVariableParser.ConvertString(si, subVarInfo, Nothing, wfTime) End Using End Using 'Users Can Supply Either WFProfileName or WFProfileID. If Name Is Supplied Resolve To ID Dim wfProfileID As Guid = Guid.Empty Dim wfProfileInfo As WorkflowProfileInfo = Nothing If Not Guid.TryParse(wfProfile, wfProfileID) Then 'Profile Name Was Supplied wfProfileInfo = BRApi.Workflow.Metadata.GetProfile(si, wfProfile) Else 'ProfileID Was Supplied wfProfileInfo = BRApi.Workflow.Metadata.GetProfile(si, wfProfileID) End If 'Validate WFProfile Supplied Is A Valid Profile If wfProfileInfo Is Nothing Then Throw New XFUserMsgException(si, Nothing, Nothing, $"Error: Invalid workflow profile [{wfProfile}]") Else wfProfileID = wfProfileInfo.UniqueID End If 'Users Can Supply Either WFTimeName or WFTimeID. If Name Is Supplied Resolve To ID Dim wfTimeID As Integer = SharedConstants.Unknown If Not Int32.TryParse(wfTime, wfTimeID) Then 'Time Name Was Supplied wfTimeID = BRApi.Finance.Time.GetIdFromName(si, wfTime) End If 'Validate WFTime Supplied Is A Valid Time If wfTimeID = SharedConstants.Unknown Then Throw New XFUserMsgException(si, Nothing, Nothing, $"Error: Invalid workflow time [{wfTime}]") End If 'Set Task Description Dim rScenarioID As Integer = GeneralHelpers.GetStoredSettingAsInteger(si, RCM_SettingsHelpers.StoredSettingName_ReconScenario) Dim wfClusterPk As New WorkflowUnitClusterPk(wfProfileID, rScenarioID, wfTimeID) Dim wfDesc As String = BRApi.Workflow.General.GetWorkflowUnitClusterPkDescription(si, wfClusterPk) Dim fields As List(Of String) = StringHelper.SplitString(wfDesc, ":", StageConstants.ParserDefaults.DefaultQuoteCharacter) Dim wfName As String = If(fields.Any(), fields(0), "WP#Missing") Dim taskInformation As String = $"{wfName}:S#{ScenarioDimHelper.GetNameFromId(si, rScenarioID)}:T#{BRApi.Finance.Time.GetNameFromId(si, wfTimeID)} - {OFC_SharedConsts.DataMgmtTaskPrefixReconProcess}." DataMgmtHelpers.SetTaskDescription(si, args.TaskActivityID, taskInformation) 'Make sure this DM job can run at this time (unless this was called from a UI action and we checked it already) Dim canDataMgmtJobRunChecked As Boolean = args.NameValuePairs.MPGetValueToBoolean(DataMgmtProcessHelper.CanDataMgmtJobRunCheckedKey, False) If Not canDataMgmtJobRunChecked Then Dim dataMgmtHelper As New DataMgmtProcessHelper(si) Dim params As New Dictionary(Of String, String) From { {"WFProfile", wfProfileID.ToString}, {"WFTime", wfTimeID.ToString}} Dim canDataMgmtJobRun As BoolAndTwoStrings = dataMgmtHelper.CanDataMgmtJobRun(OFC_SharedConsts.DataMgmtSeqReconProcess, params, args.TaskActivityID) If Not canDataMgmtJobRun.Bool1 Then Throw New XFUserMsgException(si, Nothing, Nothing, canDataMgmtJobRun.String1) End If End If 'Execute Process Recons Dim errorMessage As String = String.Empty Dim sScenarioID As Integer = GeneralHelpers.GetStoredSettingAsInteger(si, RCM_SettingsHelpers.StoredSettingName_SourceScenario) Dim processHelper As New ProcessReconsHelper(si, wfProfileID, sScenarioID, rScenarioID, wfTimeID, args.TaskActivityID) processHelper.ExecuteProcessRecons(errorMessage) 'Update Task Information Based On Results If Not String.IsNullOrEmpty(errorMessage) Then taskInformation &= errorMessage DataMgmtHelpers.SetTaskDescription(si, args.TaskActivityID, taskInformation, True) End If End Select Return Nothing Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function End Class End Namespace121Views0likes2CommentsUD8 Formula which checks if Base Member
Hi! New to Vb.Net here. Trying to write a UD8 formula which extracts the right 3 characters of an Entity member name, only when the member is a base member. Error message received says "'IsBase' is not a member of 'Member'." Anyone know how to make this work? If api.View.IsAnnotationType() Then 'Check if the member is a base member If api.Pov.Entity.IsBase Then 'Return the last three characters of the member name Dim membername As String = api.Pov.Entity.Name Dim lastThreeChars As String = Right(membername, 3) Return lastThreeChars Else 'Return a NoData Datacell if not a base member Return api.Data.CreateDataCellObject(0.0,True, False) End If Else ' Return a NoData Datacell if not an annotation type Return api.Data.CreateDataCellObject(0.0, True, False) End IfSolved117Views0likes2CommentsWhere 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😂😀😃89Views0likes0Comments