Skip to main content
April 1, 2016
Question

Is there an API to update WTUser fullName values?

  • April 1, 2016
  • 3 replies
  • 1776 views

I need to modify our WTUsers fullName values.

Is there an API that updates fullName?

Thanks

3 replies

1-Visitor
April 4, 2016

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_");

1-Visitor
April 4, 2016

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);

April 4, 2016

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