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...
Showing posts with label Server Object Model. Show all posts
Showing posts with label Server Object Model. Show all posts
Monday, June 12, 2017
Wednesday, July 13, 2016
We have to add sharepoint Namespace SPUtility
SPUtility.CreateISO8601DateTimeFromSystemDateTime(dateISO...
Wednesday, June 8, 2016
08
Jun
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
Coding:
if (spProjectListItem["USER"] != null)
projectMemberValue = spProjectListItem["USER"].ToString();
SPFieldUserValueCollection oFieldUserValueCollection = new SPFieldUserValueCollection(spDLRWeb,
...
Wednesday, March 2, 2016
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"];
...
Labels:
C#,
CAML Query,
Server Object Model,
SPServices
NameSapce:
Using System.Text
Coding:
strtxt append any kind text numerics.
public void bindata()
{
try{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
StringBuilder...
02
Mar
using (SPSite spSite = new SPSite(strSiteUrl, token)){spSite.AllowUnsafeUpdates = true;using (SPWeb spWeb = spSite.OpenWeb()){
SPList spList = spWeb.Lists["Enquiry"];SPListItem spListItem = spList.Items.Add();
spListItem["Title"] = "Peak";spListItem["Location"] = "India";
spWeb.AllowUnsafeUpdates = true;
spLis...
Friday, February 12, 2016
12
Feb
1;#Deepak Kumar
Get User name:
new SPFieldLookupValue(properties.ListItem["Staff Member"].ToString()).LookupValue;
Get User ID:
new SPFieldLookupValue(properties.ListItem["Staff Member"].ToString()).LookupId;
Using Split fuction:
properties.ListItem["Staff Member"].ToString();
You are going to be returned their...
Tuesday, December 15, 2015
15
Dec
SPListItem oiitem= oList.GetItemById(itemidvalue);SPFieldUrlValue furl= new SPFieldUrlValue();
furl.URL = "peakfinders.blogspot.in";
furl.Description = "Peak Finders";
oiitem["SiteURL"] = furl ;
oiitem.update()...