Recent Discussions
How can I use a Business Rule to sort a Member List in alphabetical order?
Namespace OneStream.BusinessRule.Finance.XFR_MemberListAlphabetical Public Class MainClass '--------------------------------------------------------------------------------------------------- 'Reference Code: XFR_MemberListAlphabetical ' 'Description: Use a business rule to sort a member list in Alphabetical order ' 'Usage: This will put a member list of a dimension in Alphabetical order. ' Use the following on the cube view: ' E#Member.[Name of Business Rule, Name of List in Business Rule] ' e.g. E#Root.[XFR_MemberListAlphabetical, EntityAlphabetical] ' 'Created By: Robert Powers (put in XF Ref by John Von Allmen) ' 'Date Created: 5-24-2013 '--------------------------------------------------------------------------------------------------- Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, _ ByVal api As FinanceRulesApi, ByVal args As FinanceRulesArgs) As Object Try 'This will put a member list of a dimension in Alphabetical order. 'Use the following on the cube view: ' E#Member.[Name of Business Rule, Name of List in Business Rule] ' e.g. E#Root.[XFR_MemberListAlphabetical, EntityAlphabetical] Dim Memberlistname As String = "Ent_Sort" Dim MemberListstart As String = "E#[Total GolfStream].base" Select Case api.FunctionType Case Is = FinanceFunctionType.MemberList If args.MemberListArgs.MemberListName = Memberlistname Then Dim objMemberListHeader = New MemberListHeader( _ args.MemberListArgs.MemberListName) 'Read the members Dim objMemberInfos As List(Of MemberInfo) = api.Members.GetMembersUsingFilter( _ args.MemberListArgs.DimPk, MemberListstart, Nothing) 'Sort the members Dim objMembers As List(Of Member) = Nothing If Not objMemberInfos Is Nothing Then objMembers = (From memberInfo In objMemberInfos _ Order By memberInfo.Member.Name Ascending _ Select memberInfo.Member).ToList() End If 'Return Return New MemberList(objMemberListHeader, objMembers) 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 Namespacejvonallmen4 years agoNew Contributor III18KViews6likes29CommentsCreate Excel spreadsheet from Business Rules
Does anyone know if you can create an Excel spreadsheet from Business Rules? I do not mean a csv file - I need to create multiple sheets. The OpenXMLBuilder object doesn't seem to have anything with writing files. I don't want to use a third-party object as that would require an installation or download. Thanks for any suggestions.SolvedMarcusH2 years agoContributor III13KViews0likes27CommentsCan I test a manual input before save and/or calculate
Hi all I like to check a manual data entry during save. Is this possible?SolvedChristianW4 years agoValued Contributor12KViews0likes13CommentsRunning a Custom Calculation from a Business Rule with a MemberFilter for Time periods
We are trying to do a multi-year planning application. One requirement is the ability to calculate out-months into the next year of the plan. One solution that would be very useful is the ability to run a custom calculation with a variable set of time periods. "BRApi.Finance.Calculate.ExecuteCustomCalculateBusinessRule" has an enumerated argument of CustomCalculationTimeType. One of the enumerations is "MemberFilter", but there is no indication or documentation regarding how to supply the member filter for Time periods to execute for. Would anyone know how to implement this, or where I could find the details regarding its usage? Thanks in advance for any information or leads.BrandonG3 years agoNew Contributor II10KViews1like16CommentsDeprecated GetLiteralParameterValue and SetLiteralParameterValue replacements?
I'm getting the message "'Function GetLiteralParameterValue(si As SessionInfo, isSystemLevel As Boolean, parameterName As String) As String' is obsolete: 'This is a temporary function used by Marketplace Solutions for backwards compatibility with old XF versions. Please change your code to use supported functionality.'." Anyone know what object & method should I be using instead? strSomeString = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si,Nothing,"pm_SomeParameter")SolvedRobbSalzmann2 years agoValued Contributor II9.2KViews3likes19CommentsClear data on Origin Forms
Does anyone have a piece of code to clear data on the origin Forms member for just a few accounts? The api.data.clearcalculateddata is not possible (data is not calculated) and api.data.setdatacell doesn't work. Thanks.SolvedRob4 years agoNew Contributor8.5KViews2likes8CommentsBusiness Rule debug
Hello, I'm new to Business Rule, and I'm struggling with the execution of a data management step with type "custom calculate". Currently, the execution of this script is giving me the message below : Error processing Data Management Step 'CC_FY2022_BUD'. Unable to execute Business Rule 'CopyData'. Invalid destination data unit in script 'A#Account1:C#Local:T#2022M1:S#Budget:U1#None:U3#T:U8#None:O#Import'. In the Data Management step, I have defined elements in the POV and Data Units, and "Data Units" elements seem to be taken into account correctly, but elements in the "POV" such as U2, U4, U5, U6, U7 elements that have been defined in the POV of data element task (hierarchy nodes) seem like is not considered in the calculation. So here are my questions: - What is the error message mentionned above actually saying ? - Are POC elements from the Data Element task taken into account in the Finance Business Rules ? - How do you efficiently debug a Business Rule ? Many thanks for your prompt answers 🙂 Regards,SolvedSergey4 years agoContributor III8.4KViews0likes7CommentsOneStream .Net Platform Language
Was the OneStream product itself built using VB.Net? If so, I'm pretty impressed!! If it was built using C#, I'm wondering why customers are then forced to use VB.Net for business rules? It seems like a double standard. Is there a licensing reason why VB.Net is redistributed to customers while C# is not? If it isn't about licensing then maybe onestream has internal BR tooling that is incompatible with C#, or third party tooling that is incompatible? Any info would be appreciated. Obviously the selection of either .net language it is a matter of choice ... but if OneStream picked C# for development of the product, then they should allow customers to pick C# as well for our business rules.Solveddbeavon3 years agoContributor7.9KViews0likes11Commentshow to debug a business rule
An allocation business rule is not allocating the rates properly . Hence we would like to debug the business rule and also figure out which intersections are passed and what is the value and allocation rate used in allocation calculation . This allocation process involves a formula in UD7 member . Please advise how to see the messages used in api.logmessage . Should we need to create a dashboard to capture the messages that are logged while running the allocations. Again, we are looking for which members used and the value / rate used to allocate.SolvedVVpackers2 years agoNew Contributor7.9KViews0likes11CommentsLog anything with JSON
I showed it at Wave and share it with all of you: when you use JSON to log, you can log anything, not just strings, you can log a Dictionary, a list, a MemberInfo, even a Databuffer. First, you need to import JSON, add these 2 rows at the top of your rule: Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq Second, when you want to log, use JSON! Dim stringobj As String = JsonConvert.SerializeObject(lCenterInfo,Formatting.Indented) api.logmessage(lCenterInfo.Member.Name & ", lCenterInfo: " & stringobj) When you use ,Formatting.Indented, your log will be correctly formatted. Thanks to Matt Ha for enlightening me with JSON and RobbSalzmannfor sharing how to have the JSON string correctly formatted!ludodepaz2 years agoContributor7.9KViews13likes15Comments