on 12-18-2007 3:36 PM
Hi,
I have wrote some code and below is a section where I am trying to update a UME attribute, but it appears not to be working.
Has anyone done anything like this......
String [] val = new String[1];
try{
IUserAccountFactory accountFactory = UMFactory.getUserAccountFactory();
IUserAccount account = accountFactory.getUserAccountByLogonId(myuser);
IUserAccount mutableAccount = accountFactory.getMutableUserAccount(account.getUniqueID());
val[0] = "6";
mutableAccount.setAttribute("com.sap.security.core.usermanagement", "*attributename*", val);
mutableAccount.save();
mutableAccount.commit();
} catch (UMException e) {
response.write("<br>Problem: " + e.getLocalizedMessage());
}// End catch (UMException e).....
Attribute appears not to be set to any value, but can read the value from this attribute, so must be in the setAttribute that is missing.
Many thanks
Hi Kai,
It depends of the datasource that your users belong to. E.g. If UME datasource is configured as LDAP and readonly
you will not managed to change this attribute.
Please check first your UME configuration.
Hope this help
Jakub Krecicki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just to let anyone know that I spotted where I was going wrong, so might help others....
Here is new code
String [] val = new String[1];
try{
IUserFactory userFact = UMFactory.getUserFactory();
IUserMaint user = userFact.getMutableUser(userFact.getUserByLogonID(myuser).getUniqueID());
val[0] = "6";
user.setAttribute("com.sap.security.core.usermanagement", "*attributename*", val);
user.save();
user.commit();
} catch (UMException e) {
response.write("
Problem: " + e.getLocalizedMessage());
}// End catch (UMException e).....
Thanks for all the help...
Edited by: Kai Chalker on Dec 20, 2007 4:46 PM
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.