1

I am creating new list using CSOM on Sharepoint Online. It's creating new list with column name as 'Title' by default. I need to rename the column to 'Description'. For that I am using Update method which is executing successfully. After updating the field name, when I try add new value to field Its showing 'Title' as field name.

Please find the screen shot for the details.

enter image description here

Here is the sample code

ListCreationInformation f_objLCInfo     =   new ListCreationInformation();
f_objLCInfo.Title                       =   "My New List";
f_objLCInfo.TemplateType                =   100;
f_objLCInfo.Description                 =   "This is new list";
_destlist                               =   _Web.Lists.Add(f_objLCInfo);
_context.Load(_destlist);
_context.ExecuteQuery(); // List is creating sucessfully.

 Field f_DestTitleColumn =  _destlist.Fields.Where(field =>
                             field.SchemaXml.Contains
                             ("82642ec8-ef9b-478f-acf9-31f7d45fbc31")).First();

f_DestTitleColumn.Title  =    "Description";
f_DestTitleColumn.Update();            
_context.Load(f_DestTitleColumn);
_context.ExecuteQuery();
2

Explanation

SharePoint uses some calculated fields along with the "Title" field, these additional calculated fields are used in Views and there internal names are "LinkTitle", "LinkTitleNoMenu"

You have changed "LinkTitle" field which changes it in the View but not in the forms, since forms display "Title" field.

In order to change completely, you have to change all three of them.

The code

The code to change all the fields related to Title:

Field f_TitleLink =  _destlist.Fields.Where(field =>
                             field.SchemaXml.Contains
                             ("82642ec8-ef9b-478f-acf9-31f7d45fbc31")).First(); //LinkTitle

f_TitleLink.Title  = "Description";
f_TitleLink.Update();

Field f_TitleColumn =  _destlist.Fields.Where(field =>
                             field.SchemaXml.Contains
                             ("fa564e0f-0c70-4ab9-b863-0177e6ddd247")).First(); //Title

f_TitleColumn.Title  =    "Description";
f_TitleColumn.Update();

Field f_TitleLinkNoMenu =  _destlist.Fields.Where(field =>
                             field.SchemaXml.Contains
                             ("bc91a437-52e7-49e1-8c4e-4698904b2b6d")).First(); //LinkTitleNoMenu

f_TitleLinkNoMenu.Title  =    "Description";
f_TitleLinkNoMenu.Update(); 

_context.Load(f_TitleLink);
_context.Load(f_TitleColumn);
_context.Load(f_TitleLinkNoMenu);
_context.ExecuteQuery();

Additional

If you are working with list definitions or content types and you want to change the title of the "Title" field, following field XML will help:

 <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Type="Text" Name="Title" DisplayName="Name" Required="TRUE"
         SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title" MaxLength="255" />
 <Field ID="{82642ec8-ef9b-478f-acf9-31f7d45fbc31}" Name="LinkTitle" DisplayName="Name" Type="Calculated" Sealed="TRUE" />
 <Field ID="{bc91a437-52e7-49e1-8c4e-4698904b2b6d}" Name="LinkTitleNoMenu" DisplayName="Name" Type="Calculated" Sealed="TRUE" />
0

You can rename the title field by going into the list settings from site contents.

site content-> List Settings -> click on Title -> Rename it -> save Changes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.