Get User List with Role & CustomUserInformation in an Actor Filter
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
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
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.