jeudi 26 février 2015

Starnge Issue : Convert Single Line of Text To Multiple line of text



I am facing a very strange issue, there is a single line of text column in SharePoint List. I want to change it to Multiple Line of text, when i go to list settings and click on the column it does not give me options to change the Column, see the screenshot attached.


This is the screen of what i see when i go to List settings then to this column


I then tried to change it using the code, Below is my code.


`



SPField field = fields[columnName];

try
{
if (field != null)
Console.WriteLine("Field Type current :" + field.Type);
field.SchemaXml = field.SchemaXml.Replace("Text", "Note");
field.Update();
NewsLetter.Update();
Console.WriteLine("Completed");
Console.ReadLine();
oWeb.AllowUnsafeUpdates = false;
}
catch (Exception ex)
{
Console.WriteLine("Message:" + ex.Message);
}

}`


I tried to run the code for my dev env and it worked the same code does not works for my prod env, where i need to make this changes. Can anyone please help this is urgent.








0 commentaires:

Enregistrer un commentaire