Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
I need to modify our WTUsers fullName values.
Is there an API that updates fullName?
Thanks
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