Saturday, November 9, 2013

How to Add a Custom List Item Programatically in SharePoint

Below is code snippet:

using (SPSite site = new SPSite("site url"))
{
   using (SPWeb Web = site.OpenWeb())
   { 
     
      SPList list = Web.Lists["MyCustomList"];

      // Add new item in List
      SPListItem item = list.Items.Add();
      item["Title"] = “My Title”;
      item["Description"] = “My Description”;
      item.Update();
     
   }
}

How to Show Edit mode for Page in SharePoint


Here is the trick:

.aspx?PageView=Shared&ToolPaneView=2 


Append the above value in the Browser to see the page in edit mode. You can start add or modify the web parts.

eDiscovery in SharePoint 2013



eDiscovery is feature of Record Management to process the legal documents in an effective manner. This will be effectively implemented by combination of SharePoint + Exchange Server + Lync Server+ File Share

This feature is useful for attorneys in civil litigation's.

Even though this concept is available in earlier versions. There are certain limitations which are addressed in SharePoint 2013

In SharePoint 2010:

Its a site level feature. When activate this feature you will get 3 options to control

Hold Reports
Holds
Discover and Hold Content

Create a Hold and Apply the Hold to Records. Kind of a lock policy will be applied to records.U can't update or delete a record once it is on Hold.

In SharePoint 2013:

A site collection template is designed to setup and configure an eDiscovery process. With the help of this template you can manage records across farm, exchange and Lync. In SharePoint 2013, users can update the content even if it is in hold.




Friday, November 8, 2013

Stop and Start Services using PowerShell


Start –> All Programs –> SharePoint 2010 -> SharePoint 2010 Management Shell

#(Enter your Service Name)

$ServiceName = “SQL Server Analysis Services” 

Get-SPServiceInstance -server $env:COMPUTERNAME | where-object {$_.TypeName -eq $ServiceName} | Stop-SPServiceInstance -confirm:$false

Get-SPServiceInstance -server $env:COMPUTERNAME | where-object {$_.TypeName -eq $ServiceName} | Start-SPServiceInstance -confirm:$false

#If you want to start Central Admin service, use the following command:

Get-SPServiceInstance | Where-Object {$_.TypeName –eq ‘Central Administration’} | Start-SPServiceInstance

BDC VS BCS

BDC

This feature available only for MOSS 2007 Enterprise Licensed version product
We can only fetch the data from external data source. Its a read-only

BCS

This feature is available with SharePoint Foundation 2010
We can perform all CRUD operations on external data sources. We can Create, Update, Delete and Query the data from the external data sources.

Tuesday, November 5, 2013

Capacity Planning in SharePoint


Capacity planning is most important step to design a proper SharePoint environment

Most important factors while designing a farm

1. Model the Architecture with WFE servers, APP Servers and Database servers. It can be either Small, Medium or Large farm based on the size and data of the Organisation.

2. Identify no of users who are going to use the farm and how frequently they do access the information.Identify concurrent requests of the users.

3. Know the limits and boundaries of the objects(Web apps, Site Collections, Lists, Pages, etc).

4. What are the all services or apps required to develop and where do we need to install them and identify role of each server farm.

5. Identify what are all servers needs to be load balanced and configure load balancing on the WFE servers

6. Procure sufficient hardware to meet the requirements. High speed configuration and enough RAM size.

7. Design a prototype server farm and install all of the components and check the usage and performance of the farm

8. Design an environment similar to production and check for the usage and tolerance of the farm. Calculate peak throughput of the farm. 

9. There are various capacity planning tools available in the market to measure the capacity planning based on the parameters.




Sunday, November 3, 2013

Custom Action in SharePoint




In this Article, I am explaining  with simple steps as how to create a New Item to Site Actions Menu using Custom Action

Follow the steps:

Create a New Empty Project in Visual Studio 2010

Rename the feature name

Go the Elements.xml file, Add <CustomAction tag element node

Declare the Title, Description, URL in URLAction

Add your ASPX file into Layouts folder
<UrlAction Url="~site/_layouts/siteactionsample.aspx"/>

If you do not have any ASPX page, for testing you can give reference to any site URLAction
<UrlAction Url="http://www.google.com"/>

Save and Build and Deploy the Project

See the result by Clicking on the Site Actions Menu

<CustomAction
         Id=””               

         Location=”Microsoft.SharePoint.StandardMenu”
         Sequence=
         Title=”My sample site”>
        <UrlAction
            Url=”~site/_layouts/siteactionsample.aspx” /> 

Saturday, November 2, 2013

REST API URI calls in SharePoint 2013


REST EndPoint URI calls

Following are common useful endpoints

If you want to access a site collection, url syntax is

     http://server/site/_api/site

If you want to access a site

    http://server/site/_api/web

If you want to Invoke search

   http://server/site/_api/search

If you want to Invoke List

   http://server/site/_api/web/lists/getbytitle('list name')


For more information, visit url: http://msdn.microsoft.com/en-us/library/office/dn292556.aspx

CSOM + JQuery + JSON in SharePoint


Here is sample example to invoke Custom List using web service in Client Side object model

var lstURL = "http://site/_vti_bin/listdata.svc/web/CustList"


$(document).ready(function () {
    $.getJSON(lstURL,function (data) {
            alert("Hi There");               
        });
});

If it is REST API, the format of the URL will be different something like

var lstURL = "http://site/_api/web/lists/getbytitle('CustList')";

Friday, November 1, 2013

Features of SharePoint Designer 2013


Design Preview is removed in SharePoint Designer 2013. We have only code view.

Copy Paste functions in workflows items(Actions, Steps) for better reusability. Added stages and loops concept when creating  workflows

We can call RESTFul web services and get the data by using "Call HTTP Web Service" Action

Dictionary Variable type. Dictionary variable holds collection of other variables. Implemented by using Build A Dictionary Action.

We can create Sequential workflows and traverse any direction

In SharePoint designer 2013, we have different workflow engine called Widows Azure Workflows. It also supports SharePoint 2010 workflows

Rich Text Email editor for better formatting features