Sharepoint 2013,2010 Change LIST COLUMN to Required Field
CSOM .
Solution:
Marking abcd column in xyz list as required
try
{
baseUrl = "http://sharepointsite:1224:/sites/mysite";
context = new ClientContext(baseUrl);
network = context.Web;
List People = network.Lists.GetByTitle("xyz");
Field f1 = People.Fields.GetByTitle("abcd");
context.Load(f1);
context.ExecuteQuery();
f1.Required = true;
f1.Update();
People.Update();
context.ExecuteQuery();
response.write("Marking abcdcolumn in list as required was sucessfull ");
}
catch (Exception ex)
{
response.write("ex.Message");
}
CSOM .
Solution:
Marking abcd column in xyz list as required
try
{
baseUrl = "http://sharepointsite:1224:/sites/mysite";
context = new ClientContext(baseUrl);
network = context.Web;
List People = network.Lists.GetByTitle("xyz");
Field f1 = People.Fields.GetByTitle("abcd");
context.Load(f1);
context.ExecuteQuery();
f1.Required = true;
f1.Update();
People.Update();
context.ExecuteQuery();
response.write("Marking abcdcolumn in list as required was sucessfull ");
}
catch (Exception ex)
{
response.write("ex.Message");
}
Comments
Post a Comment