Tuesday 3 June 2014

Steps to perform Upgrade (apply Patches) on your SharePoint Farm

These are certain basic steps to be followed whenever you install SharePoint service packs or cumulative updates on your SharePoint Farm:
  1. Take a backup of your farm - Farm backup is required but since CUs also make changes to the System Registry it is always a good idea to take a registry backup or better create an image of the existing system before applying patches. Preferably you can also keep screen shots of the services on server page for each server and the features installed in the farm to cross-check the status post installation is completed.
  2. Stop the IIS World Wide Web Publishing service (W3SVC) on all your WFEs.
  3. Install the patch (CU or SP) on the server which hosts the Central Administration first.
  4. Restart the server hosting the Central Administration, once the patch has installed successfully.
  5. Install the patch on each server (one at a time) other than your Central Administration server.
  6. Restart each server (right after the patch installation completes successfully).
  7. Run the Configuration Wizard on each server (starting with the server hosting the Central Administration site and then on each other server in the farm).
  8. Optionally, you can do one more restart of all the servers once Configuration Wizard has been run on all of them.
  9. Start the IIS World Wide Web Publishing (W3SVC) service and check your system.
Things to check once the update has been executed:
  1. Check for the System Services - SharePoint 2010 Timer Service, SharePoint 2010 Administration service etc.
  2. Check for the SharePoint services on the Central Administration - Services on Server page. They should be as they were earlier.
  3. Check IIS Application Pools and websites
Obviously, you would not be installing SharePoint updates on your Database server and finally, all this is easier said than done. These are just the general guidelines to be followed.


You would definitely be facing a whole bunch of exceptions during the process of installing the upgrades unless it is a new installation :). Those need to be taken care of based on the issues faced.


Hope this is helpful to at least understand the procedure to install upgrades.

Monday 5 May 2014

A Web Part with this ID has already been added to this page - Creating SharePoint App

I started with creating my first ever SharePoint App for SharePoint Online following this link. However, on trying to deploy my App I received the following error -


"A Web Part with this ID has already been added to this page".


I tried removing the web part (XSLT List View Web Part) and redeploying (please note that I was using NAPA for my development here) but that didn't work


I found this interesting blog post after Googling around and I appreciate the effort put in my Dragos here. According, to the post the reference of the Web Part is stored in the Content Database in the AllWebParts table mapped with the page on which it is placed. Usually, we add a web part to the SharePoint page using the SharePoint UI and delete it the same way. This would definitely add/delete the reference of the web part from the Content Database as well. However, since I was adding and removing the reference of the web part through HTML in my app, this would obviously not trigger the database for updating the reference.


Now, as I mentioned earlier, I am using SharePoint Online and therefore, cannot interfere with the database, so Dragos' solution would not work for me and as it is interfering with the SharePoint Content Database is out of limits.


So, since I could not delete the reference of the web part mapped against my page, I changed the name of my page and redeployed. And it worked!


Doesn't really help much if you are starting with a new app, but can save a lot of time if you have already implemented major functionality in your App. Either ways, it is interesting to understand the internal functioning of SharePoint.


Once again, really appreciate the MSDN Link and Drago's Post,

Friday 2 May 2014

Wrap Promoted Links Web Part - Display Multiple Rows

The Promoted Links List/App gives a decent effect to represent static links instead of the Summary Links Web Part or the Links List in SharePoint 2013, though I would like to mention that Summary Links Web Part does have a few advantages.


However, in most cases the number of tiles (links) exceeds the available content area and we have a to navigate through the tiles using scroll buttons. For a relatively small number of tiles most users find this acceptable. However, if the number of tiles is too large and a certain group of users have to regularly browse till the last link, you can surely count them out of your Friend's List!


So, to ease things a bit here is a simple javascript you can use to "wrap" the Promoted Link Tiles after a set number of occurrences i.e. say you would like to display your tiles in rows of four. You need to embed the below javascript in the page where you are displaying the Promoted Link Tiles.




==Script Begin==
<script type="text/javascript" src=http://code.jquery.com/jquery-1.10.2.min.js></script>
<script type="text/javascript">
$(document).ready(function () {
   
// Update this value to the number of links you want to show per row
var numberOfLinksPerRow = 4;
   
// local variables
var pre = "<tr><td><div class='ms-promlink-body' id='promlink_row_";
var post = "'></div></td></tr>";
var numberOfLinksInCurrentRow = numberOfLinksPerRow;
var currentRow = 1
// find the number of promoted links we're displaying
var numberOfPromotedLinks = $('.ms-promlink-body > .ms-tileview-tile-root').length;
  // if we have more links then we want in a row, let's continue
  if (numberOfPromotedLinks > numberOfLinksPerRow) {
    // we don't need the header anymore, no cycling through links
    $('.ms-promlink-root > .ms-promlink-header').empty();
    // let's iterate through all the links after the maximum displayed link
    for (i = numberOfLinksPerRow + 1; i <= numberOfPromotedLinks; i++) {
      // if we're reached the maximum number of links to show per row, add a new row
      // this happens the first time, with the values set initially
      if (numberOfLinksInCurrentRow == numberOfLinksPerRow) {
        // i just want the 2nd row to
        currentRow++;
        // create a new row of links
        $('.ms-promlink-root > table > tbody:last').append(pre + currentRow + post);
        // reset the number of links for the current row
        numberOfLinksInCurrentRow = 0    }    // move the Nth (numberOfLinksPerRow + 1) div to the current table row
    $('#promlink_row_' + currentRow).append($('.ms-promlink-body > .ms-tileview-tile-root:eq(' + (numberOfLinksPerRow) + ')'));   // increment the number of links in the current row
    numberOfLinksInCurrentRow++;  }
}
});
</script>
==Script End==


Please note that to display more number of tiles per row, increase the "numberOfLinksPerRow" variable. Also, it would be a good idea to give a local jQuery library reference instead of codeplex reference.


I have taken this script from the TechNet Article here.


Hopefully, you will be in the "Good Books" of all your colleagues! :)








Office Lens - Microsoft's mobile scanner

Office Lens works like a scanner with your mobile phone. It enhances pictures taken through your cell phone camera. You can convert documents, notes, expense bills to neat scanned copies and save them to One Note.


Obviously, there are a lot of available software that can perform the same job for free and can be used on multiple devices. However, the main appeal for Lens is its integration with Office applications.


Pictures from Lens are directly saved to One Note and using Office Online we can use them on multiple devices (actually any device with an internet connection). And since Microsoft Office is very much part of our daily lives it becomes easy to use the data.


Examples -
1. Whiteboard data during meetings can be easily re-used to create presentations
2. Restaurant bills can be easily converted to create expense claims.
3. Hard copies of multiple documents can be collected together and can be searched through for specific keywords using OCR.


But these are just a few of the examples that I could think of.


Lastly, Lens is now available on iDevices and hopefully will come up in PlayStore soon.


For more details - http://blogs.office.com/2014/03/17/office-lens-a-onenote-scanner-for-your-pocket/

Wednesday 30 April 2014

Microsoft Office on iOS and Android

Microsoft Office Products are available in the App Store and Play Store!


Though Office Online does provide most office products (for home usage) to users online it is good to have the products on your device for offline usage.


This combined with the new Nokia X series phones, which operate on Android based systems shows that new Microsoft strategy to win back the user base it is losing to these systems.


You can find more information about the office products at http://office.microsoft.com/en-us/mobile

Hope we get Lync on Android soon!

Tuesday 21 January 2014

Column Validation in SharePoint 2010 - Email and Phone Number Validation

Column Validation, I feel, is a relatively less used feature of SharePoint. If used well it can save time and lessen dependency on SharePoint Designer.

Basic validations such as date range validations or number validations can be performed by using simple expressions as well as data format validations for emails and phone numbers can be performed.

Expression for Phone validation -
=AND(
    LEN([Phone])=14,
    IF(ISERROR(FIND("(", [Phone],1)),
        FALSE,
        (FIND("(", [Phone]) = 1)
    ),
    IF(ISERROR(FIND(")", [Phone],5)),
        FALSE,
        (FIND(")", [Phone], 5) = 5)
    ),
    IF(ISERROR(FIND(" ", [Phone],6)),
        FALSE,
        (FIND(" ", [Phone], 6) = 6)
    ),
    IF(ISERROR(FIND("-", [Phone],10)),
        FALSE,
        (FIND("-", [Phone], 10) = 10)
    ),
    IF(ISERROR(1*CONCATENATE(MID([Phone], 2, 3), MID([Phone], 7, 3), MID([Phone], 11, 4))),
        FALSE,
        AND(
            1*CONCATENATE(MID([Phone], 2, 3), MID([Phone], 7, 3), MID([Phone], 11, 4)) > 1000000000,
            1*MID([Phone], 2, 3) <> 911,
            1*MID([Phone], 7, 3) <> 911,
            1*MID([Phone], 7, 3) <> 555
        )
    )
)

Expression for Email validation -
=AND(
    ISERROR(FIND(" ", [Email],1)),
    IF(ISERROR(FIND("@", [Email],2)),
        FALSE,
        AND(
            ISERROR(FIND("@",[Email], FIND("@", [Email],2)+1)),
            IF(ISERROR(FIND(".", [Email], FIND("@", [Email],2)+2)),
                FALSE,
                FIND(".", [Email], FIND("@", [Email],2)+2) < LEN([Email])
            )
        )
    )
)


I have taken these expressions from "The Chris Kent" blog. Please do visit that blog for a detailed explanation of these expressions. The links are as follows:
Finally, the pros and cons of this approach are as follows:

Pros -
  • Implementation is simple - just place the expression in the Column Validation text box
  • No customization required - no javascript/jQuery, or any other type of custom code is required.
  • Modification or management is simple
  • Replication across lists is simple
Cons -
  • Evaluating expressions for simple validations is also a tedious task
  • Due to the complexity of expressions there are limitations to the depth to which the validation can be performed. It is less flexible.
  • Error messages are displayed as field validators rather than javascript alerts (users usually prefer alerts)
- Huzefa Mala