Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Problem with Form API getOwner
System
I am using Form API to basically capture an audit trail of user/date-time of modifications to each DCR. I am having a problem with the value for IWDCRInfo.getDCRName(). It only populates with my name. I am the branch owner and manager of the security group for the pages -- I'm not sure if that is relevant or not. The documentation says that getOwner:
"Determines the owner of the file. In the TeamSite file system, the owner of the file is the last user to have modified the file."
I am having a co-worker update the DCR and this field remains populated with my name, even though the TeamSite interface shows his name in the "modified By" column. My intent is to use to update the DCR field with the onSaveValid event. But even when I populate a JavaScript alert onLoad, it always returns my name. I have success with using IWDCRInfo.getModificationDate(), so I seem to be on the right track. Here's a snippet:
var myOwnerData = IWDCRInfo.getOwner();
var myOwnerField = IWDatacapture.getItem("/dcr/updated_by/mod_owner");
myOwnerField.setValue(myOwnerData);
return true;
Any advice will be greatly appreciated.
Thanks,
Tami
Find more posts tagged with
Comments
Migrateduser
oops ... I meant to say "IWDCRInfo.getOwner()"
not "IWDCRInfo.getDCRName()"
Phanie
try this [html]myOwnerField.setValue("+myOwnerData+");[/html]
Adam Stoller
oops ... I meant to say "IWDCRInfo.getOwner()"
not "IWDCRInfo.getDCRName()"
Try using getUser() instead of getOwner() - since you're running this prior to the actual save having been completed (right?) it is likely you are retrieving the
previous
modifier and not the current one.
Migrateduser
Thanks for your help fish. This works like a charm:
var myOwnerData = IWDatacapture.getUser();
This also gets the current modifier of the DCR. I wondered if I would be getting the previous versus current modifier with getOwner.
Thanks again!
Tami