Microsoft KB Archive/923589

= Error message when you try to change the name of a site column back to its original name in Windows SharePoint Services 3.0: &quot;The column name that you entered is already in use or reserved.&quot; =

Article ID: 923589

Article Last Modified on 6/26/2007

-

APPLIES TO


 * Microsoft Windows SharePoint Services 3.0

-



SYMPTOMS
You connect to the Site Column Gallery page of a site in Microsoft Windows SharePoint Services 3.0, and then you rename a site column. For example, you rename the Department site column. When you try to change the name of the site column back to its original name, you receive the following error message:

The column name that you entered is already in use or reserved



CAUSE
This issue occurs if the following conditions are true:
 * You rename an out-of-the-box site column.
 * Another column or field in Windows SharePoint Services 3.0 uses the same display name as the site column that you renamed.

For example, the Department site column and ol_Department field both use Department as the display name.



WORKAROUND
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

To work around this issue, use the Windows SharePoint Services 3.0 object model to programmatically reset the display name of the column. The following is sample code that you can use to do this. using System; using System.Globalization; using Microsoft.SharePoint;

public class RenameField {   public static void Main(string[] args) {       int i = 0; string strWebUrl = string.Empty; string strFldInternal = string.Empty; string strFldDisplay = string.Empty; while (i < args.Length - 1) {           switch(args[i].ToLower(CultureInfo.InvariantCulture)) {               case &quot;-url&quot;: case &quot;/url&quot;: strWebUrl = args[++i]; break; case &quot;-fld&quot;: case &quot;/fld&quot;: strFldInternal = args[++i]; break; case &quot;-display&quot;: case &quot;/display&quot;: strFldDisplay = args[++i]; break; default: break; }           i++; }       if (string.IsNullOrEmpty(strWebUrl) ||            string.IsNullOrEmpty(strFldInternal) ||            string.IsNullOrEmpty(strFldDisplay)) {           PrintHelp; return; }       SPSite site = new SPSite(strWebUrl); SPWeb web = site.OpenWeb; SPField fld = web.Fields.GetFieldByInternalName(strFldInternal); fld.Title = strFldDisplay; fld.PushChangesToLists = true; fld.Update; }

private static void PrintHelp {       Console.WriteLine(&quot;Reset the display of a field template &quot; +

&quot;on the specific SPWeb:\n\n&quot; +

&quot;RenameField -url  &quot; +

&quot;-fld  &quot; +

&quot;-display &quot;);

} }



MORE INFORMATION
For more information about the Windows SharePoint Services 3.0 object model, see the Windows SharePoint Services 3.0 SDK. In order to view the Windows SharePoint Services 3.0 SDK, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/library/ms441339.aspx

Or, to download the Windows SharePoint Services 3.0 SDK, visit the following Microsoft Web site:

http://www.microsoft.com/downloads/details.aspx?familyid=05E0DD12-8394-402B-8936-A07FE8AFAFFD&displaylang=en

Additional query words: wss wssv3 switch oob out-of-box revert base

Keywords: kbbug kbpending kbexpertiseinter kbtshoot kbprb KB923589

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.