Showing posts with label Server Object Model. Show all posts
Showing posts with label Server Object Model. Show all posts

Monday, June 12, 2017

12 Jun

SharePoint List versioning using c#

We can also enable SharePoint List versioning using c# using (SPSite spsite = new SPSite("http://win7/")) { SPWeb spweb = spsite.OpenWeb(); SPList list = spweb.Lists["CustomList"]; list.EnableVersioning = true; list.Update(); } Retrieve SPListItem versions using c# using (SPSite spsite = new SPSite("http://win7/")) { SPWeb...

Wednesday, July 13, 2016

13 Jul

How to change a date format in CAML

We have to add sharepoint Namespace  SPUtility SPUtility.CreateISO8601DateTimeFromSystemDateTime(dateISO...

Wednesday, June 8, 2016

08 Jun

Unique Constraints Programmatically SharePoint

SPSite site = new SPSite("http://peakfinders"); SPWeb web = site.OpenWeb(); SPList custList = web.Lists["Employee"]; SPField vtid = custList.Fields["VoterID"]; vtid.Indexed = true; vtid.EnforceUniqueValues = true; custPhone.Update(...
08 Jun

How to add a user and multi users to the People picker field in a sharepoint list programmtically

Coding:   if (spProjectListItem["USER"] != null)       projectMemberValue = spProjectListItem["USER"].ToString();       SPFieldUserValueCollection oFieldUserValueCollection = new SPFieldUserValueCollection(spDLRWeb,                  ...

Wednesday, March 2, 2016

02 Mar

How to retrieving next 7 Days Due Date Tasks from SharePoint List

C# Coding: DateTime strdate = (DateTime)DateTime.Today.AddDays(7);             string strgetDate = strdate.Year + "-" + strdate.Month + "-" + strdate.Date.Day; SPWeb currentWeb = SPContext.Current.Web;             SPList lst = currentWeb.Lists["Projects"];  ...