locked
How to rename the default Created column? RRS feed

  • Question

  • Hello.  I would like to rename the default Created column from "Created" to "Uploaded", as this is much more appropriate for my use.  Currently, the ability to edit the name of the Created column is greyed out or not available.  I know I could create a new custom column but then all my old data would not be in that new column unless you can tell me how to easily calculate or transfer the dates for my existing items from Created to my new custom column?  This is on WSS 3.0.  Thanks.


    • Edited by Mike Walsh FIN Thursday, July 21, 2011 3:57 PM Make titles impersonal - changed
    Thursday, July 21, 2011 2:46 PM

Answers

  • HI,

    That mean you can create one console application that will copy the contents from the created by column to the uploaded one.

    You can try this code logic there

     SPSite site = new SPSite("YourSiteCollectionURL");

                SPWeb web = site.OpenWeb();

                SPList list = web.Lists["Your List Name"];

                SPListItemCollection items = list.Items;

     

                foreach (SPListItem item in items)

                {

     

                    item["Uploaded"] = item["Created By"].ToString();

     

                    item.Update();

                }

                web = null;

                site = null;

     

    I hope this will help you out.

    If the code is not clear to you do let me know and I will explain it to you.

     

    Thanks,

    Rahul Rashu

    Thursday, July 21, 2011 6:45 PM

All replies

  •  For OOB try to copy paste in DataSheet view it will not take more than 10 min.

    or 

    You can write one console application and update all your data . It will not take much time. hardly 1 hour for updating all items .


    Rahul Sharma -------------------------- Coding is all about passion !!!!!!
    Thursday, July 21, 2011 2:53 PM
  • Thanks.  I see how I can copy and paste from the datasheet view between Created and my custom Uploaded field.  The problem is that I have over 40,000 items, and it is not practical for me to go into every one and copy.  Is there a way I can "calculate" the Uploaded field from the values already present in my Created field?

    I am not sure what you mean by "write one console application".  Can you elaborate?

    Thursday, July 21, 2011 3:19 PM
  • HI,

    That mean you can create one console application that will copy the contents from the created by column to the uploaded one.

    You can try this code logic there

     SPSite site = new SPSite("YourSiteCollectionURL");

                SPWeb web = site.OpenWeb();

                SPList list = web.Lists["Your List Name"];

                SPListItemCollection items = list.Items;

     

                foreach (SPListItem item in items)

                {

     

                    item["Uploaded"] = item["Created By"].ToString();

     

                    item.Update();

                }

                web = null;

                site = null;

     

    I hope this will help you out.

    If the code is not clear to you do let me know and I will explain it to you.

     

    Thanks,

    Rahul Rashu

    Thursday, July 21, 2011 6:45 PM
  • Moderator Note:

    The only person who should say anything like "Thanks for the reply" in a thread is the OP when that message in effect confirms that his question has been answered (and the OP should also mark the post that gave him the answer).

    It makes no sense at all for someone who has not even asked a question in the thread to post a message which says (only) "Thanks for the reply". Such actions easily confuse the Moderator into thinking a thread has been closed **by the OP**.

    I have deleted such a message here. Please, Rahul-Sharma, in future by all means propose answers but do NOT write such messages.  

     

    Moderator


    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    Friday, July 22, 2011 6:19 AM