on 08-25-2010 4:27 PM
Hi , I am trying to change the attributes of a portal user id, via web dynpro Java code by using this code -
Below code is working fine for creating portal users, but not for modifying them.
** IUserFactory userFact = UMFactory.getUserFactory();**
** IUserMaint modUser = null;**
*try {*
** modUser = userFact.getMutableUser("X_User1");**
** } catch (UMException umex) {**
** //name clash will be caught here. User will not be created.**
** //logger.catching(Category.getCategory(Category.SYSTEM,"ELUM"), umex);**
** manager.reportException(umex.getLocalizedMessage(),true);**
** return false;**
** }**
**
** modUser.setFirstName("DiffFirstName");**
Its saying modUser already Exists and is not unique. ( as code assumes , it has to create a new id instead of changing one ).
Hi ,
Try this code to change the attribute.
try {
IWDClientUser LoggedUser = WDClientUser.getCurrentUser();
IUserMaint User = UMFactory.getUserFactory().getMutableUser(LoggedUser.getSAPUser().getUniqueID());
User.setFirstName("true");
User.commit();
} catch (UMException e) {
wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);
}
catch(WDUMException e1)
{
wdComponentAPI.getMessageManager().reportException(e1.getMessage(),true);
}
Revert in case of problems.
Best Wishes
Idhaya R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you need to pass a Uniwue name for getting the Mutable user i.e here
modUser = userFact.getMutableUser("X_User1");**
here X_User1 is not a unique name. You can find the unique name in the Identity managemnt or get the Unique name dynamicaaly by this code
UMFactory.getUserFactory().getUserByLogonID("X_User1").getUniqueID()
where X_User1 is the login ID of the user.
Regards,
Raju Bonagiri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.