Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand

Archive for March, 2014

Print button on InfoPath form

Posted by Jean Paul on March 26, 2014

In this article we can explore a real-life scenario to show a Print button on an InfoPath form in view/edit mode. You can also extend the solution to other list forms.

Why Print button needed on forms?

By default there is no print button on SharePoint forms.



Following are the steps needed to achieve the Print button solution. We are using HTML & JavaScript for the solution.

Step 1: Enable Modeless forms

By default the view/edit forms are opened in dialog forms. We need to change this to edit the page.

Choose List > List Settings > Advanced Settings


Set the last option to No.

Now you can see the View form is opened in full page mode.


Following is the Edit form.


Step 2: Edit Page

Open a list item in View Form, Choose the Site Actions > Edit Page option to bring the page to edit mode. Add a Content Editor Web part & enter the following HTML contents.

<input onclick=”window.print();” type=”button” value=”Print”/>


Click OK to save the changes. Choose Stop Editing from the page tab. The page will look like below.


We added a Print button which will invoke window.print() method on click.

Step 3: Test the page

Refresh the list & open a list item in View Page. Click on the Print button & you can see the Print Dialog appearing like below.


This confirms the print functionality integration. You can also repeat the same for Edit form.

Step 4: Enable back dialog

Now we need to enable back the dialog form. Go to List Settings > Advanced Settings & enable the Dialog option.


You can see the Print button there too.


The print() method prints the contents of the current window.

Custom Action

For having a custom action you can refer the solution below:




In this article we have explored a scenario of showing Print button on InfoPath forms.

Posted in SharePoint, SharePoint 2010, SharePoint 2013 | Tagged: , , , | Leave a Comment »

Active Directory Sync Tool

Posted by Jean Paul on March 23, 2014

While working with SharePoint On-Premise & Online editions, one need to perform the following:

  1. Synchronize On-Premise Active Directory Accounts to Online Active Directory
  2. Synchronize Online Active Directory Accounts to On-Premise Active Directory

In short, the requirement will be Two-way Synchronization

Active Directory Sync Tool

The Directory Directory Synchronization Tool enables us to securely synchronize selected data between an on-premise Active Directory and the Forefront Online Security.


You can download the tool from following location:


Download Link


Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

Managed Navigation

Posted by Jean Paul on March 23, 2014

In this article we can explore the new feature in SharePoint 2013 called Managed Navigation.

What is Managed Navigation?

Managed Navigation enables to build navigation (menu bar, side bar) for a publishing site that is derived from SharePoint managed metadata taxonomy. 

Managed Navigation allows Terms to be associated with a navigation item.

What are the Advantages?

Following are the advantages of Managed Navigation:

1. Multi-Level Navigation

2. Friendly URLs

3. Centrally Managed

4. Search friendly

Multi-level Navigation helps to build sub-menus in a publishing site.


Friendly URLs will look like below:


Central Management helps us to created/update/delete navigation items in one location, without any need to duplicate the changes. All the sites & sub sites will reflect the changes immediately.

Search friendly works with the search ability & discoverability of the content which is associated with a term. Tagging a page with a term and using Search Web Part improves the search ability.

How a Managed Navigation looks like?

A page after configuration of managed navigation looks like below.


How to perform Managed Navigation?

Following are the steps needed to setup Managed Navigation.

Step 1: Enable Publishing Feature & Configure Managed Metadata Service

From Site Collection Features, ensure Publishing feature is enabled.


Configure Managed Metadata Service & Ensure the services are running correctly.


Step 2: Enable Managed Navigation

Open Site Settings > Managed Navigation link. Choose the Managed Navigation radio option.


From the third section, choose the Create Term Set option. Click OK button to continue.

After doing that you can see that the top menu bar and the side link bar got disappeared.


Step 3: Create Terms

Now we can create Terms to be displayed in the navigation menu & quick launch area. Open Site Settings > Term Store Management. Expand the Site Collection item and choose Create Term.


Create hierarchical terms like below.


Step 4: Test Page

Refresh the home page. You can see the Menu bar with sub-levels inside it.


You can click on the menu items & it will throw invalid page error, as we have not configured navigation urls. You can go back to the Term Store & Set Navigation URLs for each term.



You need to create separate pages or sites to use the URL against Navigation.



In this article we have explored Managed Navigation feature of SharePoint 2013.

Posted in SharePoint, SharePoint 2013 | Tagged: , | Leave a Comment »

Copy JS files to Library using Module

Posted by Jean Paul on March 22, 2014

Often in SharePoint Projects we need to copy our JS / CSS / IMAGE files into a SharePoint Library. We can perform the same using Visual Studio Modules and package in a WSP.

What is a Module?

Modules are containers of files. We can use Modules to deploy files through a WSP file.


We are trying to deploy a JS file into an existing library.


Please follow the steps below to do the deployment.

Step 1: Create new project

Create a new project and name it as ModuleTest.


Choose the farm solution option.


Step 2: Add Module

Choose Solution Explorer > Add New Item > Module


Enter the name of the module as ModuleName for ease of understanding.

You will get the following module inside Solution Explorer.


Please note that there are 2 items inside a Module:

1. Elements.xml which contains information on files to be deployed

2. Sample.txt which is a dummy file to be deployed

Step 3: Add JS file

Right click on the Module & Add a new file. Name it as My.js.


You can also delete the sample.txt file. Now your Solution Explorer looks like below:


Step 4: Modify Elements.xml

We need to modify the Elements.xml now. Following is the current contents.


Please note that the Module contains an inner node for File. We can have multiple files deployed through this tag.

The Path of the File element shows the file path in solution. Url denotes the destination location after deployment.

In our case we need to change the destination to an existing library name. Please make the following changes.


We added the Url tag at the Module level to mention the library name. Specifying Type as Ghostable In Library ensures the file will be available for check in check out operations.

Step 5: Create Library

Create a library named Documents inside the SharePoint site.


Step 6: Deploy

Right click on the Solution Explorer and click the Deploy option.


Step 7: Test

Now we are ready to test the existence of file in the library. Open SharePoint & Navigate to the library.

You can see a new folder name is created.


Inside the folder you can find the file.



If the library name is invalid, you will get a deployment error.

How to copy to a new library?

If you wanted to copy to a new library, I would suggest add a library to the solution & ensure the library is getting deployed first. After that the module deployment should reach the correct library.



In this article we have explored how to deploy JS files using modules. The same knowledge can be used in deploying CSS/HTML/Image files.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , | Leave a Comment »

SharePoint Anti-Virus Configuration

Posted by Jean Paul on March 21, 2014

While working with SharePoint the Administrator may have to deal with Security Threat of virus-infected files.  The files uploaded can be infected & it can cause wide-spread across the network creating a bigger chaos of loss or productivity hours.

To tackle this problem, SharePoint provides Anti-Virus Configuration.

How to configure anti-virus?

Open Central Administration > Security tab.

You can see the Manage antivirus settings link in the appearing page.  Click on it.


On clicking the link, you will get the following page.


By default it will be unchecked.  Following are the options available:

Scan documents on upload will scan the documents on upload/save operation.

Scan documents on download will scan the documents on download operation

Allow users to download infected documents will allow users to download documents even if it is infected.  This is allowable if users have separate infrastructure to deal with infected documents.

Attempt to clean infected documents will try to clean the infected documents.

SharePoint Realtime Scan Job

Microsoft Forefront Security for SharePoint is the underlying component that performs the anti-virus functionality coupling with SharePoint.  The scanning operations will be implemented through Realtime scan jobs installed in the server.

We can configure the number of Threads  in the text box shown above.


Forefront Protection is discontinued after 2015, Please find the ant-virus alternatives for SharePoint using References section.



In this post we have gone through an overview of Antivirus Settings in SharePoint. 

Posted in SharePoint, SharePoint 2010, SharePoint 2013 | Tagged: , | Leave a Comment »

New Developer Dashboard in SharePoint 2013

Posted by Jean Paul on March 17, 2014

In this article we can explore the new Developer Dashboard in SharePoint 2013.

What is Developer Dashboard?

Developer Dashboard is an Instrumentation Framework. It allows us to trace request, SQL queries, and ULS logs within the browser.

The URL for accessing Developer Dashboard is:


Following is the screen shot of the latest Developer Dashboard.


How to enable Developer Dashboard?

By default the Developer Dashboard is disabled.

We have to turn it to ON state from the current OFF state. To turn it ON, open the SharePoint Command Window (In Administrative Mode) & enter the following PowerShell command.

if ((Get-PSSnapin “Microsoft.SharePoint.PowerShell” -ErrorAction SilentlyContinue) -eq $null)
    Add-PSSnapin “Microsoft.SharePoint.PowerShell”

$content = ([Microsoft.SharePoint.Administration.SPWebService]::ContentService)

$dashboardSettings =$content.DeveloperDashboardSettings

$dashboardSettings.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On


On enabling it, we can see the Dashboard icon in default master page.


Please note that you can get the PowerShell Snapin Script from here:


We can click on each Request URL to view the associated Instrumentation data:

1. Server Info

2. Scopes

3. SQL

4. SPRequests

5. Asserts

6. Service Calls

7. ULS

8. Cache Calls


Using the SQL tab, we can extract the SQL associated with a request.


You can click on the SELECT link to see the query associated.



Using the ULS tab, we can extract the Unified Logging Service outputs associated with a request.



Please note in SharePoint 2010 we had the ULS integrated with the page which lead to page loading performance issues.



In this article we have explored New Developer Dashboard & How to enable it.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

SPCOP – Another Need Tool

Posted by Jean Paul on March 17, 2014

SPCOP CE is a Visual Studio extension to analyze SharePoint code.

SharePoint Code Check Community Edition


We can analyze different SharePoint versions using it:

  1. MOSS 2007
  2. SharePoint 2010
  3. SharePoint 2013

It analyzes the following:

  1. Memory Dispose Check
  2. Features, Content Types, List Templates
  3. XML files
  4. ASPX, ASCX files

It also provides continuous integration facilities.


You can download the tool from:



Download & Install the tool. 


I am using Visual Studio 2012.  After installations restart Visual Studio.

We can do a simple testing to ensure it is working.


Create a new console SharePoint project & add a web part into it.

Inside the web part, please add the following code.

(Please note that we are not disposing the explicitly created SharePoint object)


Build the project & run SharePoint Code Check from the Solution Menu.


If successfully installed, you can see the Dispose error being caught.


This confirms you have SPCOP CE successfully installed.



In this post we have explored another need tool for SharePoint application development.  For advanced needs like verifying WSPs, there is a client tool available with higher editions.

Posted in SharePoint, SharePoint 2010, SharePoint 2013 | Tagged: , , , | Leave a Comment »

Activate Solution is Disabled (greyed out)

Posted by Jean Paul on March 17, 2014



Following are the solutions that we can try one-by-one:

  1. Restart Internet Explorer in Administrator Mode
  2. Ensure SharePoint User Code Host is running in Windows Services
  3. Ensure Microsoft SharePoint Foundation Sandboxed Code Service is started in Central Administration > Manage Services

Once applying the solution(s) the Activate button turned to be Enabled now. Great!!


Posted in SharePoint, SharePoint 2010 | Tagged: , , , , , , | 2 Comments »

Migration Template

Posted by Jean Paul on March 11, 2014

In the world of SharePoint, occasionally we need to work with other worlds too.

For example: Migration is such an area of work.


What is Migration?

Migration is the process of moving from one computing system to another.

For example Migration can be:

1. SharePoint older-version to SharePoint newer-version

2. Another CMS to SharePoint

3. SharePoint to Another CMS

4. SharePoint On Premise to SharePoint Online

What will be the Migration Steps?

Migration requires the following aspects:

1. Analyzing existing environment

2. Capturing migration elements

3. Creating a migration plan

4. Creating a target staging environment

5. Performing migration against staging environment

6. Analyze the readings

7. Optimize strategies

8. Declare migration dates to stake holders

9. Take production to offline

10. Perform final migration

11. Validate migration

12. Take production to online


Migration Template

Following are the screen shots of a Migration Template to capture information about source system. You are free to download it.


Screen shots from the template.





Please note that in a typical scenario, automated/manual migration happen from source to staging & then automated migration to production.

A good automation tool I can recommend is Sharegate. Spending for automation tool is worth if the no-tool cost is higher than tool-cost.



In this article we have explored migration overview and a shareable template.

Posted in SharePoint, SharePoint 2010 | Tagged: , , , | Leave a Comment »