Hi all,
I'm trying to get the user full name using SI_FULLNAME. I tried the code below but it doesn't work. I also tried to list all the properties for the object but It doesn't display any fullname.
I've got the error :
Failed to retrieve the users. Exception caught: La propriété portant l'ID SI_USERFULLNAME n'existe pas dans l'objet
which means :
The property with the ID SI_USERFULLNAME doesn't exist in the object.
This exception is thrown by the code : "((IUser) user).getFullName();"
I guess this is because it is a LDAP user and the code should, thus, be different.
I had no luck on the forum finding it.
Thank you in advance for all the help you could provide.
public String getUsers(IInfoStore infoStore) { String HTMLString = ""; IInfoObject user = null; try{ // Query for all server group objects, which have the // ProgID "CrystalEnterprise.User". IInfoObjects users = infoStore.query("Select TOP 999999 SI_ID, SI_NAME, SI_FULLNAME From " + "CI_SYSTEMOBJECTS Where SI_PROGID='CrystalEnterprise.USER' ORDER BY SI_NAME"); if (users.size() == 0) { // The query returned a blank collection (no object found). HTMLString = "<option value='0' disabled>No user accounts found"; } else { // Retrieve each server group from the collection and build the // drop down box. Set the server group's ID as the value for the // option element. This will garauntee its uniqueness.ENDLOC_ for (int i = 0; i < users.size(); i++) { user = (IInfoObject) users.get(i); HTMLString = HTMLString + "<option value='" + user.getID() + "'>" + ((IUser) user).getFullName(); } } }catch (SDKException e) { throw new Error ("Failed to retrieve the users. Exception caught: " + e.getMessage()); } return HTMLString; }
Best regards,
Add a comment