Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
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
Solved! Go to Solution.
Yes. Call RevisionControlled.getModifier() instead
Yes. Call RevisionControlled.getModifier() instead
Thank you Mathew, it works like a charm.