Wednesday, October 31, 2012

Unique ID in Sharepoint List



To begin with, is that really possible???
Can we have a automatically generated number for a column is Sharepoint?
The answer is.... YES, it is possible to have it.

I don’t think we can add a new unique auto-generated ID to a SharePoint list without custom code, but there already is one there by default. If you edit the “All Items” view you will see a list of columns that do not have the display option checked.
You would see the ID column unchecked there.




Select that column to your view and you will get a unique auto incrementing column for your list.

ID column is a Sharepoint system generated column


Monday, October 29, 2012

Metadata Mapping in SharePoint 2010



I have already published a post on how to create a custom search scope. 


Now I am going to create managed metadata properties that are mapped to the columns in my list.
A full crawl is already done after the search scope was created. So I am not repeating that again.

1. From the Central Administration, Application Management page click on Manage Service Applications



2. Click on Search Service Application or select it then click manage from the ribbon bar.


3. Click Metadata Properties. Then click new managed property.



4. Enter the property name as CustomManagedMetadataProperty1. In the use in scope section check the Allow this property to be used in scopes option and then click on the Add Mapping button to add the mapping between the new managed metadata and custom site column (Column1).



 5. On clicking on add mapping the following screen will pop up. Use the find button to look for the Column1 property (custom site column), select it, and then click OK. 





6. Repeat Step 4 & Step5 to add one more managed metadata property named CustomManagedMetadataProperty2 for the site column Column2.


Now we have successfully created new managed metadata properties (CustomManagedMetadataProperty1 and CustomManagedMetadataProperty2) that are mapped to the custom site columns (Column1 and Column2) where the search needs to be performed.



Fix for mailto links open with Lotus Notes or Microsoft Outlook

1) Open regedit.exe


2) Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\mailto\UserChoice

3) Double click on Progid.Change it to :

LotusNotes.URL.mailto

On clicking mailto: links Lotus Notes will now open them automatically.

3) If you want the links to open in Outlook, do step 2 and put the below value:
                                           
Microsoft Outlook.Url.Mailto

Some example of mailto: links :

mailto:fahad@test.com
mailto:fahad@test.com?subject=that was cool

Sunday, October 28, 2012

Sharepoint 2013 Vs Sharepoint 2010


SharePoint 2013
SharePoint 2010
What is SharePoint 2013 (Preview) -
A new version of Microsoft famous Collaboration portal called SharePoint. The version adds few new exciting features such as Social Feed,SharePoint Apps and cross-site publishing.
What is SharePoint 2010 - It is a previous or I should say current version of SharePoint that was released in year 2010.
Development Changes –
  • In SharePoint 2013 Microsoft Introduced a new Cloud App Model for designing Apps for SharePoint. Apps for SharePoint are self-contained pieces of functionality that extend the capabilities of a SharePoint website. You can use HTML, CSS, JavaScript and protocols like the Open Data protocol (OData), and OAuth to communicate with SharePoint using Apps.
  • Tools – SharePoint 2013 has Introduced new Tools for App development. Visual Studio 2012 now lets you develop apps for SharePoint and apps for Office. In addition a new web-based tools called “Napa” Office 365 Development Tools were introduced for developing apps.
  • No more Sandbox solutions. SharePoint 2013 sandboxed solutions are deprecated. So all we got is the New App model and the Old SharePoint Farm solutions. check out SharePoint 2013 – Apps Vs Farm solutions
Development Changes –
  • SharePoint 2010 Introduced Sandbox solutions to help developers deploy code that did not effect the whole farm.
  • In SharePoint 2010 you could use Server Object model and Client Object model (.Net Managed, ECMASCRIPT and silverlight) to extract data from SharePoint.
  • In SharePoint 2010 developers were also developing Farm solutions as they did with the previous SharePoint 2007 version.
Social and Collaboration features –
Microsoft in SharePoint 2013 Introduced new Social capabilities for better collaboration in the company.New Features added are -
  • Interactive feed
  • Community Site
  • Follow people
  • Follow Sites
Social and Collaboration features - SharePoint 2010 had very few social capabilities.
  • My sites
  • Tags and Tag profile pages
  • Notes
Search - SharePoint 2013 includes several enhancements, custom content processing with the Content Enrichment web service, and a new framework for presenting search result types. Some of the features added are –
  • Consolidated Search Results
  • Rich Results Framework
  • keyword query language (KQL) enhancements
Search – SharePoint 2010 had Introduced Integrated FAST search as an Enterprise search. In addition to this build-in SharePoint search is still widely used in companies.
Enterprise Content Management (ECM) -
SharePoint 2013 added some of the best capabilities of an ECM software. The newly added stuff is
  • Design Manager
  • Managed Navigation
  • Cross-site Publishing
  • EDiscovery
Enterprise Content Management (ECM) - SharePoint 2010 on the other hand had Introduced Managed metadata and taxonomy as a part of new ECM benefits for SP 2010. This version did not had Managed Navigation and Cross-site Publishing. SharePoint designer was a primary tool to modify Master pages instead of the new Design Manager.




Reference: http://www.learningsharepoint.com/2012/07/25/sharepoint-2013-vs-sharepoint-2010/

Sharepoint 2013 Preview Hands-On


      I started going through Sharepoint 2013 since the beginning of last week. This is a preview version. 
I had been planning to do a digging around for a month now. Finally, got some mood and time.

Configuration and software in my box

 OS: Windows Server 2012 RC x64Spec: 80 GB HD / 8 GB RAM Installed:
 SharePoint Server 2013 Preview
 Office Professional Plus 2013 Preview
 Visio 2013 Preview
 SQL Server 2012 Standard
 Visual Studio 2012 RC Professional Edition
 SharePoint Designer 2013 Preview
 Adobe Reader


It looks visually appealing. But otherwise it looks pretty much the same.
My analysis is that architecture wise there is not much a change.

I will start with the Central Administration.


Central Administration Console

It pretty much looks the same, except the extra section for Apps

Now let us do some site browsing.

1) A screenshot of a team site.



2) The Site Actions has been replaced with settings icon on the right top. (I had spent a lot of time figure that).The ribbon is still there.







3) I tried going into the setting pages of the sites(in 2007 and 2010, it was _layouts/settings) by typing into the URL. One thing I noticed was the inclusion of 15 in the URL.

http://sp2013srv/_layouts/15/settings.aspx
http://sp2013srv/_layouts/15/user.aspx
http://sp2013srv/_layouts/15/ManageFeatures.aspx
http://sp2013srv/_layouts/15/regionalsetng.aspx
http://sp2013srv/_layouts/15/mcontent.aspx
http://sp2013srv/_layouts/15/AdminRecycleBin.aspx  (being some of them).

4) In the Site Settings page, I found this different.Search is having its own section in Sharepoint 2013(48x48).I need to figure what that means.Previously Search was under Site Collection Administration itself.















I also tried out some stsadm commands out of curiosity.The stsadm is still there.




The Sharepoint Designer 2013 view screenshot.This is what I saw.



Let us open up the SQL Management Studio to see the databases.
Not much change here too.


At first glance,I feel there is not much revolutionary changes like the move from SPS 2003 to MOSS 2007 and MOSS 2007 to SP2010.

The changes look more cosmetic.(like IPhone5 release,but in that case , at least the performance improvement was huge.)


Yeah...I do  think that the move of Microsoft to move towards implementing social networking features on SharePoint is kind of successful. MySite does look like a mini Facebook.  :-p


And one more thing to add,SP2013 in my box was slow.The same configuration in SP2010 had better response.


I will be writing a detailed article on this soon. I hope my opinion changes to a more positive one J

Friday, October 26, 2012

URL Encoding (The "%20" codes in Sharepoint URLs)



How are characters URL encoded?

URL encoding of a character consists of a "%" symbol, followed by the two-digit hexadecimal representation (case-insensitive) of the ISO-Latin code point for the character.

Example
            Space = decimal code point 32 in the ISO-Latin set.
            32 decimal = 20 in hexadecimal
            The URL encoded representation will be "%20"


Unsafe characters

Why: Some characters present the possibility of being misunderstood within URLs for various reasons. These characters should also always be encoded


Character
Code
Points
(Hex)
Code
Points
(Dec)
Why encode?
Space
20
32
Significant sequences of spaces may be lost in some uses (especially multiple spaces)
Quotation marks
'Less Than' symbol ("<")
'Greater Than' symbol (">")
22
3C
3E
34
60
62
These characters are often used to delimit URLs in plain text.
'Pound' character ("#")
23
35
This is used in URLs to indicate where a fragment identifier (bookmarks/anchors in HTML) begins.
Percent character ("%")
25
37
This is used to URL encode/escape other characters, so it should itself also be encoded.
Misc. characters:
   Left Curly Brace ("{")
   Right Curly Brace ("}")
   Vertical Bar/Pipe ("|")
   Backslash ("\")
   Caret ("^")
   Tilde ("~")
   Left Square Bracket ("[")
   Right Square Bracket ("]")
   Grave Accent ("`")

7B
7D
7C
5C
5E
7E
5B
5D
60

123
125
124
92
94
126
91
93
96
Some systems can possibly modify these characters.


Reserved characters

Why: URLs use some characters for special use in defining their syntax. When these characters are not used in their special role inside a URL, they need to be encoded.


Character
Code
Points
(Hex)
Code
Points
(Dec)
 Dollar ("$")
 Ampersand ("&")
 Plus ("+")
 Comma (",")
 Forward slash/Virgule ("/")
 Colon (":")
 Semi-colon (";")
 Equals ("=")
 Question mark ("?")
 'At' symbol ("@")
24
26
2B
2C
2F
3A
3B
3D
3F
40
36
38
43
44
47
58
59
61
63
64


Thursday, October 25, 2012

“The selected cells are read-only” error on Custom Field when trying to insert in Datasheet mode




At times , when we try to edit a list in datasheet view it gives the below error.

















List Datasheet View Is Read-Only When Content Approval Is On in a Sharepoint List

How to turn off Content Approval

1. Browse to the list for which Content Approval is to be turned off.

2. Click Settings next to the Actions menu. 

3. On the dropdown menu for Settings, click List Settings.

4. In List Settings page, under General Settings, click the Version Settings.

5. On the Version Settings page, set the Require content approval for submitted items option to No and click the "OK" button.

Now you should be able to edit the list and do bulk copy-paste.


Once the editing is completed, please make sure that Content Approval Is Turned ON (as before).


How to Hide View All Site Content and Recycle Bin in Quick Launch



Code

<style>

.s4-specialNavLinkList {

display:none;

}

</style>



1)Browse to the page where the  View All Site Content and Recycle Bin needs to be hidden. Add a Content Editor webpart on the page.Put the above style code in a content editor web part.



2) Edit the web part, click in the content zone, then on the ribbon, Editing Tools -> Format Text area, select the HTML drop down and click Edit HTML source. Paste the code in there, and save.




3) In the webpart properties , make the Chrome Type as None and under Layout , check Hidden.





4) Stop editing the page and save it. 

Tuesday, October 23, 2012

How to create a custom Search Scope at a Site Collection Level



1) Go to Site Actions -> Site Settings
(Our site collection URL is http://servername/SitePages/Home.aspx)


2) Site Collection Administration -> Search Scopes



3) New Scope





4) Enter the title and description of your new scope. Select the Search Dropdown (this will display the new scope in the Search dropdown)



5) The new scope is created (fahad)



6) I am adding a rule for this scope. I am entering a custom list name in the site to be searched. Click OK.



7) You will have to wait for ( 15 minutes in this case) for the scope to be updated



8) Meanwhile , I did a full crawl from Central Administration Search Administration.

(Refer to my post below :



9) After this, create a basic search center below the site collection level. (http://servername/SearchCenter/default.aspx)




10) Now browse to Site Action -> Site Settings ->Site Collection Administration ->Search Settings













11) Make the changes as shown below. Click OK



12) Browse to the home page of the site now.

13) Pull down the Search drop down. The new custom Search scope (fahad) is displayed now.Perform the search.Voila :-)








How to do a full crawl for Search from Central Administration




1) Browse to Central Administration -> Manage Service Application



2) Click on Search Service Application



3) In Search Administration page, click on Content Sources on the left navigation



4) Click on Local SharePoint Sites




5)Add you SharePoint sites to be crawled (here).





5) Select the Local Sharepoint Sites -> Start Full Crawl




Thursday, October 18, 2012

Content database exclusively for one site collection from Central Administration


There are times when we would want to create a content database exclusively for one site collection.
I learnt a work around from one of my seniors (Manish Chopra) long time back(between 2007-2008) while I was working for Honeywell


1)Browse to Central Administration -> Application Management -> Manage content databases



2) Add a new content database for your web application.



3)So now you have 2 content database for your web application.



4)Now change the database capacity settings for your web applications other content database .

P.S. The database capacity setting values must be greater than the number of existing sites in the database, and warning site count must be less than the maximum site count.



5) Create a new site collection.This would be created in the new content database [WSS_Content_1000_additional]




6)Now repeat step 4 for your new content database[WSS_Content_1000_additional].Revert back the settings to default for the old content database[WSS_Content_1000].

7) You are all set now.All new site collections would be created in your old content database[WSS_Content_1000].And the newly created content database [WSS_Content_1000_additional] would be exclusve for the site colelction you created in step 5.

Tuesday, October 16, 2012

How to create new site collection in new content DB in SharePoint


Option 1:

In this case from central administration, I am going to create a new content database and then change the Maximum Number of Sites value to equal Current Number of Sites for all the databases except the new one to make sure that the site is created in new database(temporarily).[I will post a different article for this soon and link it from here :- )][http://pitstopsharepoint.blogspot.com/2012/10/content-database-exclusively-for-one.html]

1. Create a new content database for the given web application (Central Administration -> Manage Content Databases)

2. Change the values for the Maximum Number of Sites value to equal Current Number of Sites (Central Administration -> Manage Content Databases)

3. Create the new site collection from the central admin (Central Administration -> Create Site Collection)

 
4. Revert back the changes (Central Administration -> Manage Content Databases)

Option 2:
In this case, we are creating a new content database first for the web application and then creating the site collection in that content database.

1. Add New Content Database to the Web Application

New-SPContentDatabase -Name <content_db_name> -WebApplication <web application URL>

2. Create New Site Collection in the New Content DB

New-SPSite <required site collection URL> -OwnerAlias <owner account name including domain name e.g.domain\username> -ContentDatabase <content_db_name> -Name <Name of your site collection> -Description <Description of site collection> -Template <template name,team sites template name is “STS#0″>