Forum Discussion
MarcusH
5 months agoContributor III
I think a custom member list is what you need. There is an example in GolfStream. I have changed the code so that it should do what you want. Change myText4String to the string you want to search for.
Imports System
Imports System.Data
Imports System.Data.Common
Imports System.IO
Imports System.Collections.Generic
Imports System.Globalization
Imports System.Linq
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports OneStream.Shared.Common
Imports OneStream.Shared.Wcf
Imports OneStream.Shared.Engine
Imports OneStream.Shared.Database
Imports OneStream.Stage.Engine
Imports OneStream.Stage.Database
Imports OneStream.Finance.Engine
Imports OneStream.Finance.Database
Namespace OneStream.BusinessRule.Finance.MemberLists
Public Class MainClass
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.MemberListHeaders
Dim objMemberListHeaders As New List(Of MemberListHeader)
objMemberListHeaders.Add(New MemberListHeader("MemberList1"))
Return objMemberListHeaders
Case Is = FinanceFunctionType.MemberList
'Example: E#Root.CustomMemberList(BRName=MyBusinessRuleName, MemberListName=[Sample Member List], Name1=Value1)
If args.MemberListArgs.MemberListName.XFEqualsIgnoreCase("MemberList1") Then
Dim objMemberListHeader As New MemberListHeader(args.MemberListArgs.MemberListName)
Dim objMemberInfos As List(Of MemberInfo) = api.Members.GetMembersUsingFilter(args.MemberListArgs.DimPk, "E#Root.Base.where(Text4 = myText4String)", Nothing)
Dim objReturnMembers As New List(Of MemberInfo)
For Each objMem As MemberInfo In objMemberInfos
objReturnMembers.Add(objMem)
Next
Return objReturnMembers
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 Namespace
Related Content
- 12 months ago
- 11 months ago
- 11 months ago