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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Can anyone help me with a little function?

ptc-1047216
1-Newbie

Can anyone help me with a little function?

Hi all,

The function below returns the creator of a wt.document, how (if possible) would it need to be changed in order to return the principal who last updated the document instead of it's creator?

public static WTUser getCreatedBy(WTObject pbo){

try {

pbo = (WTObject)PersistenceHelper.manager.refresh(pbo);

if (pbo instanceof RevisionControlled){

return (WTUser) ((RevisionControlled)pbo).getCreator().getPrincipal();

} else {

log.error("Object was not revision controlled");

return null;

}

} catch (WTException ex) {

log.error("Unable to find creator",ex);

return null;

}

}

Many thanks advance.

B

ACCEPTED SOLUTION

Accepted Solutions

Yes. Call RevisionControlled.getModifier() instead

View solution in original post

2 REPLIES 2

Yes. Call RevisionControlled.getModifier() instead

Thank you Mathew, it works like a charm.

Top Tags