Forum Discussion

JérémyRenard's avatar
JérémyRenard
New Contributor III
5 days ago

How can I retrieve the name of the form template using a finance business rule?

Hello everyone,

Thanks to this discussion: https://community.onestreamsoftware.com/discussions/WorkflowDI/forms-by-entity/13417

I can now show or hide the input cube views based on whether or not the group entity has been released, as stored in Entity Text6.

However, by doing this, I lose the ability to display cube views only for the quarter, half-year or full year.

Currently, I display the cube views every month if the entity is present in the group, so this does not apply to cube views that should be displayed quarterly.

I would therefore like to retrieve the name of the form displaying each data entry cube view, so that I can define in the Business Rules whether each form should be displayed monthly, quarterly, half-yearly or only in December.

This would allow me to use the settings provided natively by OneStream, which I have previously bypassed.

But I am unable to do so.

Is this feasible?

The ultimate aim is to prevent accidental data entry into workflows that should no longer be populated.
I have already removed accountants’ access to the workflow for entities that have left the group, but the central team still has access, and I would like to prevent them from accidentally entering data for periods when the entity has left the group.

Thank you for your help

3 Replies

    • JérémyRenard's avatar
      JérémyRenard
      New Contributor III

      Hello MarcusH

      That’s actually the link I used to create my business rule.

      But I’m not sure how to retrieve the name of the cubeview or form selected by the user, so that I can specify in my business rule whether that form should be displayed monthly, quarterly or at some other interval.

      • MarcusH's avatar
        MarcusH
        Valued Contributor

        As far as I know the args parameter does not contain the name of the Form that is calling the Business Rule. You have to add a parameter to the Frequency Member Filter like this:

        T#Root.CustomMemberList(BRName=MyBRName, MemberListName=IsFormValidForEntity, FormName=[0001])

        You then process the parameters like this:

        Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As FinanceRulesApi, ByVal args As FinanceRulesArgs) As Object
        	Try
        		Select Case api.FunctionType
        			Case Is = FinanceFunctionType.MemberList
        				#Region "IsFormValidForEntity"
        				If args.MemberListArgs.MemberListName.XFEqualsIgnoreCase("IsFormValidForEntity") Then
        					'-- Usage: T#Root.CustomMemberList(BRName=myBRName, MemberListName=IsFormValidForEntity, FormName=[0001])
        					Return IsFormValidForEntity(si, globals, api, args)
        				End If   
        				#End Region
        			.....
        		End Select
            Catch ex as exception
        		....	
            End try		
        End Function
        			
        Private Function IsFormValidForEntity(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As FinanceRulesApi, ByVal args As FinanceRulesArgs) As MemberList
        	Try
        		#Region "Form Parameters"
        		' Get the parameters passed through from the Form Template
        		Dim thisFormName As String = args.MemberListArgs.NameValuePairs.GetValueOrEmpty("FormName")		
        		#End Region
        
        		' Build member list with Time members.
        		
        		Return memberList
            Catch ex as exception
        		....	
        	
        	End try
        End Function