"Created By" column

Jun 18, 2009 at 11:36 AM
Edited Jun 18, 2009 at 2:22 PM

I can't select the "Created By" column as a destination. I would really like to use that column instead of creating another person lookup (since you'd have to fill it out each time with your name).

Any thoughts?

EDIT:

I created a temporary column and stored the user in there. Then I looped over the list items in the Object Model and copied the value from the tempcolumn to the "Created By" column.

 

If anyone's interested, here's the code:

 

SPSite site = new SPSite("http://localhost/");
SPWeb web = site.OpenWeb();
foreach (SPField field in web.Lists["MyList"].Items[1].Fields) {
    // Find out the GUIDs first...
    //System.Console.WriteLine(field.Title + ": " + field.Id);
}
Guid tmpColumn = new Guid("35607e2f-baeb-4594-9487-573d83a13cb9");
Guid createdBy = new Guid("1df5e554-ec7e-46a6-901d-d85a3881cb18");
Guid modifiedBy = new Guid("d31655d1-1d5b-4511-95a1-7a09e9b75bf2");
foreach (SPListItem item in web.Lists["MyList"].Items) {
    if (item[tmpColumn] != null && item[tmpColumn].ToString() != String.Empty) {
        item[createdBy] = item[tmpColumn];
        item[modifiedBy] = item[tmpColumn];
        item.Update();
    }
}

 

 

Coordinator
Jun 22, 2009 at 8:34 PM

I'm not sure that column is editable via the webservices.  There are some columns that SharePoint tries to control, for security reasons. You can imagine the trouble if you could just go modifying the createdby/updatedby from an auditing perspective on rows of data.