I have seen lots of post requesting to get the way to retrieve disable or inactive user search. There is business reason to get the user count but there is no way to get it with direct query through Query Builder.
I came across a situation where we do need inactive and active users’ counts and users details but there was no way. We do work for all type of Business Object Java SDK 4.0 on business needs.
We write a search engine using Java SDK API’s to get the result. It’s a simple java program which connects to CMS and search for user with give parameters. Let me take you in deeper way to get the idea:
1) We retrieve the user list by passing search criteria
// Sample query
SELECT SI_NAME, SI_USERFULLNAME FROM CI_SYSTEMOBJECTS WHERE SI_KIND = ‘User’
2) We add then search criteria like user first name or user last name
// Sample query
SI_ENT_CUSTOM_MAPPED_ATRIBUTES.SI_FIRSTNAME like ‘%xxxx%’ and SI_ENT_CUSTOM_MAPPED_ATRIBUTES.SI_LASTNAME like ‘%xxxx%’
3) Once the query gets built up, it connect to CMS and get enterpriseSession to get the list of user through the query run
4) We process the list of user to retrieve the active (enable) or Inactive (disable) user. It’s done through the API call. We have Interface IUserAliases. We iterate through the User object and get the user status on alias basis
// sample code
IUserAliases boAliases = user.getAloases();
Boolean userStat = boAliases.iterator().next().isDisabled();
// the above piece of code helps to get the user status
5) We put all the active and inactive user in list and send back whenever we need.