Posts

Access List properties with REST APIs

Syntax to use REST API for List:                 <sharepoint web url>/_api//web/lists/GetByTitle('List Title')/<property name> Properties which can be retrieved: S. No Property Type 1 AllowContentTypes Boolean 2 BaseTemplate Int32 3 BaseType Int32 4 BrowserFileHandling Int32 5 ContentTypes SP.ContentTypeCollection 6 ContentTypesEnabled Boolean 7 Created DateTime 8 DataSource SP.ListDataSource 9 DefaultContentApprovalWorkflowId GUID 10 DefaultDisplayFormUrl String 11 DefaultEditFormUrl String 12 DefaultNewFormUrl String 13 DefaultView SP.View 14 DefaultViewUrl

Copy List Item Programmatically

public void CopyItem(SPListItem srcItem, SPListItem destItem) { foreach (SPField field in srcItem.Fields) { if (!field.ReadOnlyField && field.InternalName != "Attachments") { destItem[field.InternalName] = srcItem[field.InternalName]; } } foreach (string attachmentName in srcItem.Attachments) { SPFile file = srcItem.ParentList.ParentWeb.GetFile(srcItem.Attachments.UrlPrefix + attachmentName); byte[] data = file.OpenBinary(); destItem.Attachments.Add(attachmentName, data); } destItem.Update(); }

December 2014 Cumulative Updates For SharePoint 2010

The Cumulative Update (December 2014) for SharePoint 2010 has been released : SharePoint Foundation: http://support2.microsoft.com/kb/2899585 SharePoint Server 2010: http://support2.microsoft.com/kb/2899583 Project Server 2010: http://support2.microsoft.com/kb/2899587 Office 2010 : http://support2.microsoft.com/kb/3020815

Export ContentDataBase Name in csv file

<# Created by : Gaurav Goyal    Purpose : To Export Content Database Name in csv file.    Comments : Run With Admin Privileges \ Read operation. #> $csv="./CSV.csv" $i=1; SC $csv "ID,DBName,WebApplicationName,CurrentSiteCount" write-host "`nGetting WebApplication Names`n"; $WebApps = Get-SPWebApplication  foreach($WebAppUrl in $WebApps) { write-host "$i) Getting ContentDataBase name of WebApp" $WebAppUrl.Url "`n" ;$i++; $toCSV=Get-SPContentDatabase -site $WebAppUrl.Url; AC $csv "$($toCSV.Id),$($toCSV.Name),$($toCSV.WebApplication),$($toCSV.CurrentSiteCount)" } write-host "Exporting List of All DB.....`n" Get-SPDatabase | epcsv ".\AllDataBaseList.csv"