cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

Is there an API to update WTUser fullName values?

emanarello
3-Visitor

Is there an API to update WTUser fullName values?

I need to modify our WTUsers fullName values.

Is there an API that updates fullName?

Thanks

3 REPLIES 3
RenatShaimardan
5-Regular Member
(To:emanarello)

I think, you can try PersistableAdapter (or depricated LWCNormalizedObject )

PersistableAdapter PObj = new PersistableAdapter(WTUser,null,null,null);

PObj.load("fullName");

Object AttrValue=PObj.get("fullName");

attrs.put("fullName", "_newUserFullName_");

Setting WTUser attributes is a protected action so I believe you will at least need to be an Org Admin. Renat Shaimardanov's suggestion should work just fine or even something like the following will work.

WTUser user = getUser("userName");

user.setFullName("New Name");

PersistenceHelper.manager.save(user);

Thank you both for your suggestions!

They both worked, but I marked Christopher's answer as correct because of its simplicity. The PersistenceHelper did the trick!

Again, thanks a bunch for getting me unstuck

Eileen

Top Tags