Get User List with Role & CustomUserInformation in an Actor Filter

1
0
-1

Hi everyone,

I would like to know if it possible to get a list of user with SearchOptionBuilder in an Actor Filter, using the role of the user and his customUserInformacion.

I already have a filter using SearchOptionBuilder with a Role ID to get the list of user, but in this scenario I need to get users using the Role ID and some of the customUserInformation to do it.

Thanks.

Jorge

3 answers

1
0
-1
This one is the BEST answer!

The SearchOptionsBuilder has "or" method, you can try with something like

searchBuilder.leftParenthesis()
searchBuilder.filter(CustomUserInfoValueSearchDescriptor.DEFINITION_ID, 1);
searchBuilder.filter(CustomUserInfoValueSearchDescriptor.VALUE, yourfirstvalue);
searchBuilder.rightParenthesis()
searchBuilder.or()
searchBuilder.leftParenthesis()
searchBuilder.filter(CustomUserInfoValueSearchDescriptor.DEFINITION_ID, 2);
searchBuilder.filter(CustomUserInfoValueSearchDescriptor.VALUE, yoursecondvalue);
searchBuilder.rightParenthesis()

I haven't test it though

1
0
-1

Hi Enrico,

Thanks for the info, I got the idea.

But when I tried with 2 custom info in the SearchOptionBuilder I get no results, but when I used only one filter i get results.

I've been trying with this code for the SearchOptionBuilder:

optionsBuilder.filter(CustomUserInfoValueSearchDescriptor.DEFINITION_ID, agencias.get(0).getId());
optionsBuilder.filter(CustomUserInfoValueSearchDescriptor.VALUE, idAgencia);
optionsBuilder.filter(CustomUserInfoValueSearchDescriptor.DEFINITION_ID, regionales.get(0).getId());
optionsBuilder.filter(CustomUserInfoValueSearchDescriptor.VALUE, idRegional);

Thanks.

1
0
-1

Hello Jorge,

I guess you need to do two searches and merge the results, not sure it's possible to do with a single shot.

You know how to do the first search, for the second one you can create a SearchOptionBuilder and use a CustomUserInfoValueSearchDescriptor

Cheers

Notifications