Skip to main content
Newcomer
October 7, 2024
Solved

How to search for member in list of members

  • October 7, 2024
  • 1 reply
  • 0 views

Hi,

I have a requirement where I need to compare a member in list of members (listOfmem) and see if the member exists in list. How to best handle this as it seems like I can't use "Contains" function?

 Dim listOfmem As list(Of memberinfo) = BRApi.Finance.Members.GetMembersUsingFilter(si, U2DimPk, U2DimMem, True)
 
Thank you in advance,
Mikki
Best answer by KarlT

You can try this this approach where the listofmem is defined per your question:

If listOfmem.Any(Function(x) x.Member.Name = "MemberName") Then
	brapi.ErrorLog.LogMessage(si,"found")
End If

 

1 reply

KarlTOneStream EmployeeAnswer
OneStream Employee
October 7, 2024

You can try this this approach where the listofmem is defined per your question:

If listOfmem.Any(Function(x) x.Member.Name = "MemberName") Then
	brapi.ErrorLog.LogMessage(si,"found")
End If