Rules to Better SharePoint Development

Since 1990, SSW has supported the developer community by publishing all our best practices and rules for everyone to see. ​

If you still need help, visit SharePoint Server ​Consulting​ and book in a consultant.​​

Hold on a second! How would you like to view this content?
Just the title! A brief blurb! Gimme everything!
Do you agree with them all? Are we missing some? Let us know what you think.
  1. Are your Developers Managing your Projects with TFS (with proven Agile/Scrum and ALM Strategies)?

    Team Foundation Server is the fully integrated solution to manage projects, giving developers, testers and management a single source of truth for all project needs.

    Project Managers and stakeholders will love:

    • TFS's integration with code/SQL/SharePoint which provides a dashboard with project reports, giving them greater visibility of the project status and burn down lists
    • The easily customization of the data using Excel Web Services

    Developers will love:

    • TFS 2010 for the SQL and SharePoint Server Explorer and the integration of viewing, creating and deploying
    • That they don't have to try to interpret a bug report from a tester, and then they have to reproduce it. Why? Because of Intellitrace, which allows you to double click and open to the exact line of code with the variables set.
    • Seamless source control
    • No waiting for compiling and tests to run. The integration with the build server (continuous integration) is the biggest productivity boost you can give a developer
    • SharePoint Wiki

    Testers will love:

    • The many ways of automating their manual tests via:
      • Web tests
      • Performance tests
      • And the jewel in the crown, Coded UI Tests
    • The fact they never have to spend time reproducing a bug before documenting it
    • And it gets better, they don't have to document it because testing tools recorded what they did
    • Later on, when they decide to go with Lab Manager they will never spend time setting up that special environment (say running windows 95 and IE6)

    Managing your SharePoint Projects with TFS (with proven Agile/Scrum and ALM Strategies)

  2. ASP.NET vs SharePoint development - do you know deployment is different?

    In ASP.NET deployment is a simple xcopy. Or you can right click the Web Site project and  "Publish Web Site" in Visual Studio.

    Fugure: Publish Web Site in Visual Studio

     

    In SharePoint the way to deploy a set of changes is via a solution package.

    SharePoint provides additional layer and infrastructure on top of ASP.NET  - part of this layer is the support for administrators (who may not be developers) to quickly add, remove, activate and deactivate features across a SharePoint site farm.

    These are awesome features and something that basic ASP.NET does not have, but it does add additional development overhead to build the solution packaging.

    1. You need to create such a package via VSeWSS (or a similar tool such as WSP Builder)
    2. Add entries for all the files you want to include in the package
    3. Update and get the latest version of the files from development SharePoint or TFS
    4. Compile the package into a WSP file (which is a cab file)
    5. Test the package on a staging server.
    6. Deploy it on a production server.
  3. ASP.NET vs SharePoint development - do you know source control is different?

    In ASP.NET
    Typically, the team will store the code on a source control system such as TFS (Team Foundation Server), check it out to their own local system, develop and test locally then check it back into source control for sharing.

    In SharePoint
    SharePoint comes with its own document control and version history out of the box. This is great for collaborating between developers and designers, but isn’t available for everything.

    Differences
    Unlike TFS, SharePoint does not support multiple check-out so each file can only be checked out to one person at a time.  The modification must be checked back into SharePoint.

    We think the following are best tracked on a development SharePoint server:

    • Master page
    • Page Layouts
    • XSL
    • CSS

    And these should not (or cannot) be version controlled on SharePoint server:

    • Low level customizations such as custom web parts should still be developed in VS.NET and stored in TFS.
    • Package files to build solution packages should be stored in TFS.
  4. Do you always set InfoPath compatibility mode to design for both Rich and Web client forms?

    ​This is the number one, and most important rule in working with InfoPath.

    Always go for the lowest common denominator.  It sure beats realizing half way later that your form can't be hosted on SharePoint InfoPath Forms Services!


  5. Do you always use Data Connection Library for InfoPath forms?

    SharePoint allows you to create a Data Connection Library to hold all the connection information that Forms and Excel services can utilize.

    You should always use a Data Connection Library.

    Data Connection Library provides a central location for defining all the connections to various data sources within your company.

    • It allows you to change the data source definition in one place, without having to worry about changing the same definition in 50 forms and excel spreadsheets.
    • A centralized data connection library also helps your users to locate data easily.
    • Your users don't want to know the intricate details on how to get a particular data - they just want the data and have the form working!  So if you as the administrator provides it for them, they will love you, they will use it, and you will have an easier time managing your SharePoint site!​
    Everyone wins!
  6. Do you create a minimal master page?

    To create a master page or reuse an existing master page is a time-consuming process. Because you have to determine what the Office SharePoint Server 2007 page model requires — necessary content placeholders and controls to work with the page layouts.

    Another problem of Default.master is that it contains many tables that are difficult to style.
    <%@Master language="C#"%>
    ...
    <HEAD runat="server">
    ...
    <Title ID=onetidTitle>
    <asp:ContentPlaceHolder id=PlaceHolderPageTitle runat="server"/>
    </Title>
    ...
    </HEAD>
    <BODY scroll="yes” ... >
    <form runat="server" onsubmit="return _spFormOnSubmitWrapper();">
    <WebPartPages:SPWebPartManager id="m" runat="Server"/>
    <table class="ms-main" CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%" HEIGHT="100%">
    <tr>
    <td>
    <asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation" runat="server">
    <table CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%">
    ...
    </table>
    </asp:ContentPlaceHolder>
    </td>
    </tr>
    <tr>
    ...
    </tr>
    <tr>
    <td id="onetIdTopNavBarContainer" WIDTH=100% class="ms-bannerContainer">
    <asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
    ...
    </asp:ContentPlaceHolder>
    </td>
    </tr>
    <tr height="100%">
    <td>
    <table width="100%" height="100%" cellspacing="0" cellpadding="0">
    ...
    </table>
    </td>
    </tr>
    </table>
    <asp:ContentPlaceHolder id="PlaceHolderFormDigest" runat="server">
    ...
    </asp:ContentPlaceHolder>
    ...
    </form>
    <asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server"/>
    <asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server"/>
    <asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server"/>
    </BODY>
    </HTML>
    Bad example - using default master page

    So we recommend using the minimal master page which includes the necessary placeholders.
    To create a minimal master page

    1. Open SharePoint Designer.
    2. On the File menu, click New, point to SharePoint Content, and then click the Page tab.
    3. Double-click Master Page to create a new master page.
    4. Click Design to show the master page in design view. You should see header and left margin areas and several content placeholders in the master page.
    5. Click Code to show the master page in code view.
    6. Copy the code into the master page
      SharePoint 2007 - https://msdn.microsoft.com/en-us/library/office/aa660698(v=office.12).aspx
      SharePoint 2010 - https://msdn.microsoft.com/en-us/library/office/dn205 ​273.aspx
      <%@ Master language="C#" %>
      ...
      <html>
          <WebPartPages:SPWebPartManager runat="server"/>
          <SharePoint:RobotsMetaTag runat="server"/>
          <head runat="server">
              <asp:ContentPlaceHolder runat="server" id="head">
                  <title>
                      <asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server" />
                  </title>
              </asp:ContentPlaceHolder>
              <Sharepoint:CssLink runat="server"/>
              <asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server" />
          </head>
          <body onload="javascript:_spBodyOnLoadWrapper();">
              <form runat="server" onsubmit="return _spFormOnSubmitWrapper();">
                  <wssuc:Welcome id="explitLogout" runat="server"/>
                  <PublishingSiteAction:SiteActionMenu runat="server"/>
                  <PublishingWebControls:AuthoringContainer id="authoringcontrols" runat="server">
                      <PublishingConsole:Console runat="server" />
                  </PublishingWebControls:AuthoringContainer>
                  <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" />
                  <asp:Panel visible="false" runat="server">
                      <asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server"/>
                      ...
                  </asp:Panel>
              </form>
          </body>
      </html>
          Good example - using minimal master page
    7. On the File menu, click Save As, provide a unique file name with the .master extension, and then save the file to the master page gallery (/_catalogs/masterpage) in your site collection.
  7. Do you know common web configuration stuff you will need?

     In SharePoint, web configuration includes:
    1. ASP.NET 3.5/4.0 library references – this is necessary for all the ASP.NET AJAX calls
    2. Add system.web/pages/controls – to add additional tag prefix from System.W eb.Extensions
    3. Add HttpModule (for example – to clean up extra JavaScript from SharePoint)
    4. SafeControl tags for all custom dlls – in general these can be added via your solution package as well

    You should always use a SPConfigModification class to modify your web.config – never tell your user or administrator to make changes manually!  This also allows them to switch off a feature from SharePoint knowing that the changes had been reverted.

    For developers – you must test your SPConfigModification carefully, mismatched XPath will cause problems in your web.config and create duplicate entries!
  8. Do you know the ASP.NET skills that do not translate (aka different) ?

    ASP.NET is file system driven, SharePoint is database driven – all SharePoint content and meta data comes from a database, include images, HTML, Master Page, etc. SharePoint provides a framework where components can be plugged in, and out of the box these areas are improved:

    • Security model, membership, permissions
    • There’s a relatively consistent UI framework
    • Menus, navigation and site maps
    • Administration of access, site owners can change permissions for that site – without admins

    Deployment model is very different:

    • ASP.NET has MSI file or XCopy deployment – individual server
    • SharePoint deployment is via Solution Package – but goes cross site farms
    • Deployment is both declarative in XML format, as well as in code with Feature and Event receivers

    Tools:

    • ASP.NET is mostly done in Visual Studio .NET
    • SharePoint development is split among:
      • Internet Explorer – SharePoint configurations (note: non IE browsers remain 2nd level and isn’t as good as IE with SharePoint)
      • Microsoft SharePoint Designer – SharePoint HTML page design and customization
      • Visual Studio .NET – custom web parts, custom workflows, solution packages
  9. Do you know to *never* touch a production environment with SharePoint designer?

    • SharePoint designer can silently reformat your code and introduce errors.
    • If you modify any master page or page layout file with SharePoint designer, it becomes customized. This means that SharePoint is now looking at a customized version stored in the database rather than the version on the file system. You then can't deploy future changes, because SharePoint will now always serve the customized version instead of the ghosted version in the solution package.
  10. Do you know that developers should do all their custom work in their own SharePoint development environment?

    This is to prevent their work affecting other developers. During development, you can expect many of these things to happen:
    • IIS resets may need to be done frequently, which stops the SharePoint website working.
    • Custom web parts can easily introduce memory leaks which can stop SharePoint working.
    • You may be running development SharePoint in debugging mode which would hold the server thread.
    • You may be reading event or error logs that are being polluted by other developers simultaneously.

    Thus, all SharePoint customization and development must be done on a Virtual Machine. No ifs, no buts.

    1. It's very important to correctly setup a SharePoint environment for development. Correctly configured, this will save you a lot of trouble later on.
    2. From time to time, you can seriously screw/damage a SharePoint installation during development and it is best not to install SharePoint on your day-to-day machine.
    3. Additionally, when you start a new SharePoint project you don't want to carry all the baggage from previous customizations that could potentially affect your new project.​

    There are many other benefits of using a virtual machine for development

    1. Virtual machines can be fired up and shut down easily
    2. Virtual machines can run faster, via being located on a different server and thus it doesn't waste developers' own computer resources
    3. Virtual machines can be copied and brought to a client for demonstration or testing
    4. They are the best way to quickly test or experiment with something new
    5. Virtual machines can frees up resources on the host, so it doesn’t waste resource when developers are not working on SharePoint
    6. Virtual machines can be easily cloned to scale up the development team
    7. Virtual machines enable developers to work in Windows Server 2003 / 2008 environment so they will be aware of the configuration issue when deploying to staging and production

    There are few considerations when using Virtual Machines:

    1. Need to activate additional servers
    2. Need at least 2 GB of RAM for SharePoint 2007
    3. Need at least 4 GB of RAM for SharePoint 2010
    4. Virtual PC does not support 64 bit Operating Systems 
      • If you’re using Windows 7 or Vista, we recommend using ‘boot to VHD’ or VMWare

    If you are after a clean, pre-configured SharePoint server image to test SharePoint, the easiest way is to download a trial ​VM from Microsoft

    Tip: More info on setting up SharePoint VM
  11. Do you know the ASP.NET skills that translate?

    Microsoft SharePoint Technologies is built on top of ASP.NET technologies.  In particular, MOSS 2007 is based on ASP.NET 2.0, SharePoint 2010 is based on ASP.NET 3.5, SharePoint 2013 is based on ASP.NET 4.​

    This means that there are many skills that an ASP.NET developer already has that can be translated to SharePoint directly.

    • Master Pages – SharePoint uses master pages
    • Site Map – SharePoint uses the ASP.NET site map provider model and comes with many additional customized site map providers out of the box
    • Menu – SharePoint uses ASP.NET menu controls, powered by site maps
    • Page Control Lifecycle – the same key fundamental knowledge for ASP.NET is also necessary when making custom SharePoint development
    • Web.Config – like ASP.NET – many SharePoint configuration is done in the Web.Config – though SharePoint provides web UI to modify many of these options from Central Administration
    • .NET – Your .NET skills are definitely not going to go away
    • IIS – Each SharePoint web application is a “Site” in IIS, the site bindings are also identical
  12. Do you know the best ways to deploy a SharePoint solution?

    Development for a SharePoint solution is always risky and may involve bringing down the server from time to time.  So we always customize and develop SharePoint solutions on a separate development server.  But when your development is done, do you know how to deploy your changes to the staging and eventually the production server?

    The Bad method
    The naïve and bad method would be to just back up the entire content database, then copy the database backup to the destination server, and restore it there.

    1. Backup command:
      stsadm –o backup –url http://servername:port -filename c:\myfile.bak
    2. Restore command:
      stsadm –o restore –url http://servername:port –filename c:\myfile.bak -overwrite

    There are quite a few issues with this approach:

    1. At a glance – seems simple
    2. Any additional content at the destination server is wiped out – no content editing can continue while the development work is happening…
    3. Backup file can be extremely large as it includes version history and a lot of extra fat, the file can easily be over a few hundred megabytes!
    4. Deployment via backup and restore is not a Microsoft supported operation

    The Good method
    The better method is to build a feature or solution deployment package

    1. Build a VSeWSS project for package and deployment
    2. When built, this will produce a wsp file (this is a cab file) that can be deployed as features on the destination server

    A few considerations for this approach: 

    1. Site definitions, list definitions, layouts and masterpages, static content and webparts can all be deployed this way
    2. User content cannot be deployed this way. Any content will need to be exported and re-imported to move between development, staging and/or production servers.
  13. Do you make small incremental changes to your VSeWSS projects?

    • When working on packaging SharePoint artefacts into Features & Solutions, you should always make small incremental changes to your VSeWSS projects. Each time you should build & deploy to check you haven't broken anything.
    • You should regularly make labels in TFS so you can quickly compare your changes against previous working versions to identify problems.
  14. Do you know to do data you need CAML?

    CAML is the XML definition for all things in SharePoint, in deployment, and in creating templates, CAML is the only format.

    In SharePoint development, you will also need to know CAML, in particular, how to write a query in CAML.

    •  Widely used in Content Query Web Parts
    • Also used in SharePoint content reports
    • In code, used by SPSiteDataQuery object

     

    <Query>
    <OrderBy>
    <FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
    </OrderBy>
    <Where>
    <And>
    <Neq>
    <FieldRef Name="Status"></FieldRef>
    <Value Type="Text">Completed</Value>
    </Neq>
    <IsNull>
    <FieldRef Name="Sent"></FieldRef>
    </IsNull>
    </And>
    </Where>
    </Query>
    Figure: Example of CAML query 

    You can see - CAML is essentially the same as SQL WHERE syntax, but wrapped in an XML format.

    Problems with CAML:

    1. CAML is XML and is case sensitive – including attributes names. 
      <Query>
      <Where>
      <Or>
      <Eq>
      <FieldRef name="Status" />
      <Value Type="Text">Completed</Value>
      </Eq>
      <IsNull>
      <FieldRef Name="Status" />
      </IsNull>
      </Or>
      </Where>
      </Query>
           Figure: Example of CAML query 
    2. SharePoint is not good at telling you if you made a mistake with your CAML query.
           Figure: Debug error message
    3. Hard to debug.
      Tips: Use 3rd Party tools - U2U CAML Query Builder
           Figure: U2U CAML Query Builder
           Note: U2U CAML Builder is the best tool that we have. There are some occasional UI and interface issues, but for creating CAML and testing it against live SharePoint lists it gets the job done. And it’s FREE!

     

     

  15. Do you have a version page for your SharePoint site?

    Each time you deploy a new package to your SharePoint site, you should add a new entry in the version list.

    This will enable you to quickly find out which version of the package your SharePoint site is using, and let users know what version they are running.

     

    • A custom list for Version should be created at the root level of a SharePoint site collection, and each time a package is deployed - a new record should be added to this version list.
    • A simple blank page with a Content Query Web Part can display this versions list in a friendly manner.
    • We do not change the version numbers in the .NET Assembly because the assemblies have to be strong-name signed and deployed to the GAC.  So having a versions list is crucial in working out what version of your package is deployed on which server.
  16. Do you know to try to use the Content Query Web Part (CQWP) over the Data View Web Part (DVWP)?

    These controls are similar, but the DVWP needs heavier customization and should be avoided where possible.

    The CQWP is easier to style. The DVWP should only be used if you need one of these features:

    1. You only want to search on one column in the list, rather than all the (indexed) columns.
    2. You want to perform a search on multiple lists, but not all the lists on a web.
    3. You want to have a very specific Look and Feel that the search results use.
  17. Do you know what is broken in workflow?

    SharePoint comes with some very basic workflows out of the box.  A particular example is the content approval workflow.

    When a content approval workflow is used, it modifies the process of publishing content to be:

    1. User clicks publish (click 1)
    2. Workflow starts, and asks the user to request for approval, there’s an option to add additional messages (click 2)
    3. The workflow sends an email to the user to tell him an approval workflow has started. (email 1)
    4. The workflow also sends an email to the approver(s) (email 2)
    5. The approver receives an email, then returns to the page – they can Approve or Reject the workflow. (click 3)
    6. Either way, a new workflow screen appears, with an option to add additional messages, the approver clicks accept (click 4)
    7. The approval workflow completes and publishes the page. 
    8. It then sends an email telling the user that an approval workflow has been completed (email 3).

    What is the problem?

    The out of the box workflow is extremely generic.  It has no customizations or shortcuts.  Even if you are an approver, you cannot skip any of the steps.  The end result is that you will have to click 4 times and receive 3 emails, for approving your own finalized content.

    These kind of workflows are designed generic to fit any business’ needs – and in fact, businesses using these out of the box workflows have to adjust their staff’s workflow to match SharePoint’s ones.  Which can be counter intuitive.

    We think these SharePoint workflows need to be far more customizable.  

    SharePoint does not provide support for complex reusable workflows easily - most companies go for a 3rd party solution:

    Figure: 3rd party tool - Blackpearl
    Figure: 3rd party tool - Nintex
  18. Do you use SharePoint designer well?

    We love SharePoint designer and use it everyday. 

    But there are things that it doesn't do naturally, or it does really badly.  Here are some tips on using SharePoint designer well.

    • Don't use inline CSS - this goes for any website.
    • Always put <div class="..."> wrappers around SharePoint controls. This allows us to define styles for SharePoint controls. It is possible to use CssClass like ASP.NET, but then we lose control to SharePoint regarding how that control will be rendered.  Also, some SharePoint controls will eat up your CssClass and not render anything.
    • Naming convention for control id! Don't get lazy.
    • Turn off Auto indent.  Otherwise SharePoint designer will keep modifying your file whenever it saves the HTML - this will make you very upset.

     

    Uncheck Auto indent
  19. Do you always use Site Columns instead of List Columns?

    A site column is created on a site level and visible to all lists and content types within that site (and subsites).

    You should always try to use Site Columns instead of List Columns

    • New in WSS v3 (SharePoint 2007)
    • The same column can be added to different Content Types, lists, list templates
    • Allows you to make modifications at one place and SharePoint can apply the changes for you across the different lists and content types (doesn't try to fix the content for you though)
    • More visibility of the customization we are applying to the SharePoint website
    • Make sure the site column is added to our own group description such as "SSW Columns" - this is important for filtering and exporting site column customizations for deployment.  Also great because they are now grouped in the UI.
    Figure: Create column - Bad Example
    Figure: Add from existing site columns - Good Example
    Figure: Site Columns - Good Example

     

     

    Sometimes you still may want to use a List Column.

    • You are Mary and want to create a simple list to track supplies, but you do not have site permissions to create site columns
  20. Do you know when to use CAML instead of object model?

    SharePoint utilizes CAML to do a lot of things - one of these is using CAML to define a query language to select elements from lists within SharePoint.

    The development experience with CAML is not good.  CAML is unforgiving when it comes to errors, but it doesn't tell you what's wrong.  Thus earning it a bad name with SharePoint developers.  People don't like CAML.

    The SharePoint object model is very comprehensive and lets you select items from lists, select lists from sites, in site-collections within web-applications.

    Naturally, using the object model is great for traversing all elements in a list.  Once you have a handle to the item, you can also easily modify that item.

    On the other hand, one of the SharePoint class SPSiteDataQuery allows a developer to use CAML to specify a query condition that SharePoint can understand to search and return matching elements from across the entire site collection.

    This is the underlying class that the Content Query Web Part relies on.

    So, you need to use object model when you want to:

    • Iterate all elements in a list
    • Modify elements in a list

    And you use CAML, whether in CQWP or in code with SPSiteDataQuery to:

    • Select, filter elements from SharePoint lists
    • Select elements from multiple lists
  21. Do you know when to use SmartPart or WebPart?

    SmartPart is basically a simple but genius idea - it is a simple web part that can host a user control (ascx) inside it via the Page.LoadControl method. That way, all you have to do as a SharePoint developer is to write the ascx control, and you can do it with the Visual Studio designer to arrange the user control via drag and drop, and then when you want the web part on a SharePoint page, you load the generic SmartPart, and tell it to load the ascx that you want.

    However, there are some PRO's and CON's when you use a SmartPart:

    PRO

    1. Being able to rapidly create the control's layout and then focus on the code behind - in familiar ASP.NET user control style.

    CON

    1. Many users switch to full trust for their User Controls and disregard SharePoint security this is very easy to set up, but very bad practice.  The user control dll should be deployed to the GAC.
    2. Performance is not as good as a web part because a SmartPart is "host" by a page.
    3. Hard to deploy - this is a major problem for SSW because we use solution package to deploy web parts.  The ascx can be deployed manually to wss\VirtualDirectories\, or it can be deployed to the 12 hive via _controlTemplates/ - and then the user control referenced via ~/_layouts/controlTemplates/ but this is not an intended feature of SharePoint deployment.
    4. Hard to debug - if the ascx is written with src codebehind, then that file is compiled on demand by ASP.NET you can't debug it easily.  See xxx (link) on how to debug SharePoint.

     

    Our recommendation:

    1. Understand the difference between SmartParts and Web Parts - don't use SmartParts just because it's "easy" - there are many issues that will come back and hurt the developer.
    2. If your control does not work with SharePoint directly, or has a lot of layout elements it is OK to use SmartParts
    3. Otherwise, write your own Web Part.
  22. Does your SharePoint site have a favicon?

    ​All websites should be following the favicon rule.

    A Favicon is a small image file included on nearly all professional developed sites. When a browser hits your web site and a user bookmarks that site then the favicon.ico graphic will be displayed in the browser’s URL/address line upon subsequent visits to that site.

    Let's see how it's done for SharePoint:

    <head runat="server">
        <meta name="GENERATOR" content="Microsoft SharePoint">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <!--Placeholder for additional overrides-->
        <asp:ContentPlaceHolder ID="PlaceHolderAdditionalPageHead" runat="server" />
        <link rel="shortcut icon" href="~/Style Library/Images/SSW/Rules/ssw.ico" type="image/x-icon" />
    </head>

    Figure: One line of HTML lets you add your company's icon to  your web page
  23. Do you know where to add design files for deployment?

    When a designer (or a developer) adds design/style files to SharePoint - care must be taken regarding where the files are placed:

    • Some places are are not suitable because they are not good for deployment
    • Other places may have permission issues - designers can't access them
    • Some files are part of the site definition and should not be customized

    So our rules are:

    1. Never modify out of the box SharePoint files in /Style Library/ - those files are part of the site definition, if you customize them they are hard to deploy
    2. Start with a clean, minimal masterpage
    3. Create and reference your own CSS files and put them under /Style Library/CSS/<client>/
    4. You may want to further divide your CSS paths according to the areas of the site that your CSS is designed for:
      E.g. /Style Library/CSS/SSW/Clients/layout.css
    5. Designers can modify the XSL file as well!
      put them under /Style Library/XSL Style Sheets/<client>/
  24. Do you know why you need to use solution package instead of deployment manually?

    As a server product, SharePoint supports lots of configuration, but the support for packaging and deploying changes between servers remains very week.

    The experts agree that the best and preferred way to package a set of changes is to build a solution package.  A SharePoint solution package includes all the components and dependent files packed in a cab file.

    There are many reasons why you need to use solution package:

    1. All dependent files and components are in the package - allowing developers to quickly deploy development, testing, staging and production servers. 
    2. Manual steps are very long, and error prone
    3. Solution packages are easy to retract
    4. Minimize downtime in the SharePoint production server during an upgrade operation
    5. No content data loss during upgrades - SharePoint backup/restore deployment methods will block users from making changes to the production the site during the upgrade period
  25. Do you know you can't think of data the same way?

    In SQL Server you have tables to store data.  Then you have Views, Relations and Stored Procedures.

    SharePoint gives us Lists where we can store rows and columns of data, but it is not the same as a full database.

     
    • There are no joints out of SharePoint – you can do limited operations with lookup fields but they are not the same as joints in SQL Server
    • Views in SharePoint are filters, grouping and sort on a single list only.
    • Formula fields in SharePoint are only updated when the row is changed.  If you change the lookup value in the lookup list, it will not change any of the items using formula fields that are currently referencing that lookup.
    • No stored procedures in SharePoint

    Database remains the best at doing database work.  SharePoint is OK at creating quick lists and working with simple lists, but it is not a database server.

  26. Do You Let Your Designers Loose on SharePoint?

    Do you let your designers loose on your development SharePoint?

    This is how we work:

    • A designer would imagine and mockup the design using a graphics tool – such as Photoshop
    • After the mockups are signed off, we let the designers work on the actual page
    • Give them designer permissions to your development site and let them loose with SharePoint designer!

    There are many reasons why we believe that designers should work directly in SharePoint, with SharePoint designer:

    • In all areas of .NET development, whether it be ASP.NET, WCF or SilverLight, designers are more and more involved with the actual project beyond mockups
    • It helps them understand the limitations of SharePoint, which helps their future design to play to its strengths
    • They are also better at CSS and DOM than a typical developer, as well as more cross-browser aware
    • They are able to make a call on how close a designer can be bent when the implementation is hard or impossible - with developers who can't make that call, they may end up spending a lot of time failing to get the last 2 pixel perfect
    • SharePoint designer is sufficiently powerful and offers the only experience currently available for building with SharePoint sites
    • SharePoint has built-in check-in and check-out, as well as version controls, publishing and approval controls - all of which are excellent for team development

    The major drawback for a designer is the complexity of a SharePoint masterpage:

    <insert picture>

    Figure: Bad - Nasty looking masterpage

    Luckily, we always start with a clean-minimal masterpage, which gives our designers full freedom to implement their vision:

    <insert picture>

    Figure: Good - clean-minimal masterpage

  27. Do you use content editor web part with care?

    The Content Editor Web Part is very easy to use in any web part zone, and gives your content editors ability to add additional text and flair to a page.
    Figure: Content Editor Web Part – available in any web part zone

    However, there is a scary hidden trap!

    Figure: Content Editor Web Part looking mostly harmless...  
    So what’s bad with the Content Editor Web Part?
    • The content in a content editor web part is not version controlled.
    • If an editor accidentally overwrites a previous copy – there’s no way to go back.
    • If an editor accidentally deletes a Content Editor Web Part – the content in it is lost.
    • Data loss is always bad – and Content Editor Web Part gives you many different ways you can easily lose data... you need tread carefully and know the risks!

    The best practice is:
    1. Do your content editing in the Content Editor Web Part, or in SharePoint Designer.
    2. Click the Source Editor button afterwards to get the raw html view.
    3. Copy and save this to a plain HTML file, and save the file in the page library (which is version controlled).
    4. In the Content Editor Web Part – link to the HTML page’s URL.
      a.If the text is very tiny – may be just a big heading, you may not want to do this.
      b.Using Content Link is also another way you can re-use the same text in different web pages and update them in one place – very good for big banners.
    Figure: Using Content Link to a file - safely stored in the document library. This gives us the best of both worlds
  28. Fix HTML - Do you implement CSS friendly?

    It is extremely important to make your site standards compliant:

    • It makes styling a lot easier.
    • It also means your site is likely to work for all browsers, even if you don’t specifically target/support them.
    • It requires accessibility for big public sites can be met easier.

    When you first run your SharePoint site – you’ll discover that it looks nice on the surface but needs a significant amount of work to fix all the bad HTML.

    Implement CSS Friendly – these are the control adapters released by Microsoft to make ASP.NET render better, non-table based controls.  You can implement them for SharePoint sites as well.

    <TABLE id=zz1_TopNavigationMenu class="..." border=0 cellSpacing=0 cellPadding=0>
    <TBODY>
        <TR>
        <TD id=zz1_TopNavigationMenun0>
            <TABLE class="..." border=0 cellSpacing=0 cellPadding=0 width="100%">
            <TBODY>
                <TR>
                    <TD style="WHITE-SPACE: nowrap">
                    <A style="..." class="..." href="...">Home</A>
                    </TD>
                </TR>
            </TBODY>
            </TABLE>
        </TD>
        ...   
        <TD id=zz1_TopNavigationMenun1>
            <TABLE class="..." border=0 cellSpacing=0 cellPadding=0 width="100%">
            <TBODY>
                <TR>
                    <TD style="WHITE-SPACE: nowrap">
                    <A style="..." class="..." href="...">Operations</A>
                    </TD>
                </TR>
            </TBODY>
            </TABLE>
        </TD>
        ...
        <TD id=zz1_TopNavigationMenun2>
            <TABLE class="..." border=0 cellSpacing=0 cellPadding=0 width="100%">
            <TBODY>
                <TR>
                    <TD style="WHITE-SPACE: nowrap">
                    <A style="..." class="..." href="...">Application Management</A>
                    </TD>
                </TR>
            </TBODY>
            </TABLE>
        </TD>
        ...
        </TR>
    </TBODY>
    </TABLE>
    Bad example - without using CSS Friendly
    <div class="CssFriendly-Menu-Horizontal" id="zz1_TopNavigationMenu">
        <ul class="CssFriendly-Menu">
            <li class="CssFriendly-Menu-WithChildren">
            <a href="..." class="CssFriendly-Menu-Link TopLevelNavItem">About Us</a>
            <div class="cbb CssFriendly-Menu-Dropdown">
                <div class="CssFriendly-Menu-Dropdown-ItemHost">
                    <ul class="first">
                        <li class="CssFriendly-Menu-Leaf">
                        <a href="..." class="CssFriendly-Menu-Link">Employees</a>
                        </li>
                    </ul>
                </div>
            </div>
            </li>
            ...
        </ul>
    </div>
    Good example - using CSS Friendly

     

  29. Is your first aim to customize a SharePoint webpart?

    You should always try to configure existing out-of-the-box SharePoint webparts before you roll your own.

    The Content Query web part in particular is very flexible – allowing contents from different lists to be presented in different ways.

    These are some of the fields in the CQWP that are often configured:

    MainXslLink, ItemXslLink:

    These two controls the main and item XSL file paths.  Set these to your new XSL file under /Style Library/XSL Style Sheets/SSW/SSWMainContent.xsl and SSWItem.xsl files

    ItemLimit

    The default number of items that are displayed on a Content Query web part is 15.  With unlimited pages.  Sometimes you want this number to be a lot higher (or -1 for no limit).

    Note: If you do make this unlimited - make sure your page is designed to grow infinitely or the layout may look strange.

    CommonViewFields

    The Content Query web part automatically selects a few of the common fields for any query.  But sometimes you want a particular field that isn't selected by default.  This is when you should use CommonViewFields.

    The syntax is "fieldname,fieldtype;"

    E.g. PublishingContent,PublishingHTML;

    Query and QueryOverride

    The Content Query web part gives the user a lot of flexibility to design the query in the UI toolpart.  However if your needs are perculiar you can use the QueryOverride to skip over defining the query and use your supplied CAML directly.

     

    [Guid("5bbdb385-5076-4a4b-85e8-691664b7f575")]
    public class WebPart1 : System.Web.UI.WebControls.WebParts.WebPart
    {
    public WebPart1() { }
    protected override void CreateChildControls()
    {
    base.CreateChildControls();
    // TODO: add custom rendering code here.
    Label label = new Label();
    label.Text = "Hello World";
    this.Controls.Add(label);
    }
    }
    Bad Example: Inherit from System.Web.UI.WebControls.WebParts.WebPart

     

     

    public class RelatedContentByQueryWebPart:CustomContentByQueryWebPart
    {
    public string RulesKeyWords //get the column name from SharePoint
    {
    get;
    set;
    }
    protected override void OverrideQuery()
    {
    StringBuilder query = new StringBuilder();
    SPListItem item = SPContext.Current.ListItem;
    string[] rulesKeyWords = {};
    if (item != null)
    {
    ......
    }
    this.QueryOverride = query.ToString(); // pass the query
    }
    }
    Good Example: Inherit from CustomContentByQueryWebPart

     

  30. How do you deploy SharePoint?

    We use SSWPackage.exe

    The long answer:

    Deploying changes between development, staging and production servers can be a very interesting exercise:

    • It is painstakingly awkward when you realize that you have forgotten a file
    • Or forgotten to take the latest version of a particular file
    • Each iteration is manual and can be error prone
    • The result is that your developers are working late into the evening and your SharePoint servers are down for a prolonged period of time – something that may be very difficult to accept in a corporate environment

    At SSW, we saw all this was unacceptable and work to improve this process.

    Our answer to the deployment problem is a combination of tools and processes – we call it the SSWpackage.exe

    • Multiple development virtual machine environments
      • Test repeated deployment to staging before you actually deploy to the production server
    • SSW SharePoint Deployment Auditor – compares development, staging and production servers to identify missing files that needs to be deployed
      • Specify ignore lists
      • Spits out XML code that would be easy to add to your package xml
    • SSW Package Updater – updates the solution package based on the XML definitions
      • Ensure you always have the latest version of the files from development SharePoint included in your package.
    • Microsoft Visual Studio extensions for Windows SharePoint Services
      • Using the latest VSeWSS 1.3 CTP
      • Generates the package and batch files
    • SharePoint STSADM tool for deployment

    Into the future of SSWPackage.exe

    • Fully continuous integration with SharePoint
    • More SharePoint validation functions
    • Improved versioning control
    • A great GUI to bring it all together
  31. Do you use LINQ instead of CAML?

    In SharePoint development, it is always a good practice to use LINQ, instead of CAML.
    Why CAML is bad?
    • New language skills required for .NET developers
    • No IntelliSense or strongly typed objects

    Why LINQ is good?

    • No new language skills required
    • Easier to read and write
    • SPMetal is awesome for generating entity classes
    • In the backend, LINQ provider translates as much as it can to CAML first
    SPQueryquery = newSPQuery();
    query.Query= String.Format(“
    <Where>
    <And>
    <Contains><FieldRefName=‘Tags’ /><ValueType=‘Text’>{0}</Value></Contains>
    <IsNotNull><FieldRefName=‘URL’ /></IsNotNull>
    </And>
    </Where>
    <OrderBy>
    <FieldRefName=‘PostedOn’ Ascending=‘TRUE’ />
    </OrderBy>”, _filter);
    SPListItemCollectionlistItemsColl= resourceList.GetItems(query);

    Figure: Bad example – using CAML Var resourceListItems =
    From SPListItem item in resourceList.Items
    Where item.Tags.ToString().ToLower().Contains(_filter)
    && item.URL.ToString().Length> 0
    OrderBy item.PostedOn Ascending
     Figure: Good example – using LINQ
  32. Have you considered SharePoint 2010 for Internet Sites license?

    In MOSS 2007, to run a public internet site on SharePoint included many hidden costs that soon accumulate to a big number that puts it out of the reach of most small and medium companies.

    As a rough calculation - it costs over $160k to run 3 MOSS servers with internet license for internet sites.  As much as people loved the features of MOSS for publishing sites - this was a major drawback.
    Microsoft recognised this problem, and in SharePoint 2010 line up, they added an additional "SharePoint 2010 for Internet Sites" licenses for standard and enterpise features. 

    Microsoft has yet to release pricings for SharePoint 2010 - but we can expect the internet sites for standard SharePoint Server to be highly comparable.
  33. How to publish a report based on a list?

    ​When you want a Grid with filters, group by, totals and sorting, how do you do this (if all the data is in a list) ?

    There are 6 options:

    if you need to use the object model (like PublishedBy.aspx) to interate through records - use Option 1,3,5 , and we prefer option 5.

    if you need to bind a simple list  - use Option 4 (best designer, scheduling included, parameters are easy... we know that iFrame is not great).

     

     

  34. Indicate the magnitude of a page edit

    Add an extra column to the “Version History” page to show how big a change was made in each version (in number of lines modified or MB changed or something).

    In this case the editor (Ulysses) clicked on edit just to see what it looked like from an Editor’s viewpoint, but there is no indication that there was no significant change.

    The edits that were not significant should show their records as dimmed.

    Figure: Version History

    P.S. the URL should be nicer than this:
    http://sharepoint.ssw.com.au/Standards/Communication/RulesToBetterEmail/_layouts/Versions.aspx?list=1badd854%2D7165%2D46cb%2D920e%2D44e2355cd6e7&ID=2&FileName=%2FStandards%2FCommunication%2FRulesToBetterEmail%2FPages%2FDefault%2Easpx&Source=%2FStandards%2FCommunication%2FRulesToBetterEmail%2FPages%2Fdefault%2Easpx

  35. Do you use field and list item validation (in 2010)

        class CreateShoppingListHandler : SPItemEventReceiver
        {
            public override void ItemAdding(SPItemEventProperties properties)
            {
                float price = 0;
                float cost = 0;
                
                if(float.TryParse(properties.ListItem.Fields["Price"].ToString(), out price) && float.TryParse(properties.ListItem.Fields["Cost"].ToString(), out cost))
                {
                    if(price < cost)
                    {
                        properties.ErrorMessage = "The cost must not be less than the price";
                        properties.Cancel = true;
                    }
                }            
            }
        }
    Bad example: using custom code – creating a custom event receiver on the item (the item adding event or item updating event)

    Good example: using no code – just using the field validation on a list
    A demo of this from Andrew Connell on
    http://channel9.msdn.com/learn/courses/SharePoint2010Developer/ListsAndSchemas/FieldandListItemValidation/
  36. Do you know how to work with document versions?

    This is how you should work with Document Versions:
    1. Make sure your document library is configured to use versioning.
      TIP: You can configure this in Settings | Versioning Settings​
    2. Make sure you are showing the version column in your document view.
      Add a version column

      TIP: You can add the column by selecting Modify View

      ​​
    3. Whenever you edit the document and check it in, SharePoint will automatically increase the version number.
    4. If you need to send this document to a client then it is important to:

      1. Save the file locally by selecting Send To | Download a Copy
        Save a file locally
      2. Add the version to the end of the filename e.g. Specifications_v2.0.docx
      3. Then email it to the client.
      4. We do this so that we can track what version of the document was sent to the client.
      5. ​TIP: If you are not working with SharePoint then we recommend you follow the rule Do you include version numbers in your file names?

  37. Do you know the best SharePoint 2010 development environment?

    Developing in ASP.NET is easy, you just press F5, Visual Studio spins up instance of the Cassini web server, and you can see your work execute. Developing in SharePoint is much harder as you need access to a local SharePoint server to see your work run.

    In SharePoint 2007 there are three options, in SharePoint 2010 they have added one more.

    Figure: Setting up the development environment in SharePoint can give you a headache
    Your development choices in SharePoint 2007 are:
    • Remote to a shared SharePoint development server
      Tip: This is best for people who do *not* need to have their own SharePoint server, such as designers, testers or content editors.
      Problem #1: By default you only get 2 concurrent accounts
      Problem #2: IISRESET clobbers other users.
    • Run your own local virtual machine (VM)
      Tip #1: Use an external drive to make it faster
      Tip #2: Use SSD to go even faster :)
    • Use ‘Boot’ to VHD (Recommended - most trouble but best performance)
      Note: Only if you have Windows 7 as the host
      See: Less Virtual, More Machine - Windows 7 and the magic of Boot to VHD

    One of the biggest problem is that SharePoint 2007 can only be installed on Windows Server and most developer machines do not run Windows Server as the host OS. Tweaks to install SharePoint to Vista were available, but considered risky – since your development environment does not fully reflect the production server.

    In SharePoint 2010 – the scenery has changed a little. These are all your options now:
    • Remote to a shared SharePoint development server
      Tip: This is best for people who do *not* need to have their own SharePoint server, such as designers, testers or content editors.
      Problem #1: By default you only get 2 concurrent accounts
      Problem #2: IISRESET clobbers other users.
    • Run your own local virtual machine (Not recommended – because SharePoint 2010 is 64-bit only)
      Tip #1: Use an external drive to make it faster
      Tip #2: Use SSD to go even faster :)
      Tip #3: The 64-bit requirement means, you can’t use Virtual PC, and so you have to use either Hyper-V (which requires a Windows Server host), or VMWare
      Tip #4: The 64-bit requirement means, your host must be x64 to run the virtual machines in x64
    • Use ‘Boot’ to VHD (Recommended)
      Note: Only if you have Windows 7 as the host
      See: Less Virtual, More Machine - Windows 7 and the magic of Boot to VHD
    • Install SharePoint 2010 on your Windows 7 PC (Not Recommended)
      You are not fully representing the production server
    Are there any shortcuts for Silverlight developers (for SharePoint consumption)?
    • Yes, you can easily deploy a xap file to a document library. However, if you need to debug it you will need the SharePoint 2010 object model.
      Tip: You could minimise your exposure to the object model by using a Repository pattern, which would allow you to debug and test your application without SharePoint, but ultimately you will need to debug and test in SharePoint.
    Figure: The Ultimate solution for SharePoint development environments is to have another machine under your desk. The Ultimate Solution
    • Get yourself a second machine (same as remote)
    • But don’t share it with anyone else!
  38. Do you know the best way to take SharePoint data offline?

    In SharePoint 2010, there are quite a few tools that we can use to take SharePoint data offline. Let’s look at our options:
    • use Outlook to synchronize document libraries, calendar and contacts offline.
    • use Excel to take read-only copies of list data offline.
    •  use Access to take list data offline – Access also lets you edit offline and synchronize back.
    •  use SharePoint Workspace (this was Groove) to take entire Site offline, unfortunately this doesn’t work for calendars.
    We think the best way is to use Workspace instead of Outlook:
    1. SharePoint Workspace synchronize an entire site
      a. So when lists are renamed it knows about it.
      b. It also knows about new lists that are added to a SharePoint site Figure: SharePoint Workspace synchronizing an entire site
    2. Outlook can be quite busy when synchronizing to Exchange server; it is good to not burden it with more work.
    While SharePoint Workspace is quite good, we don’t like to store lists in it:
    1. Access has better filtering, sorting options when offline
  39. Do you create BCS connections to all your line of business (LOB) applications?

    In SharePoint 2007, we have Business Data Catalog to connect SharePoint to other line of business applications.
    When you connect your other systems to SharePoint you can then have one central place to see your data:
    1. Microsoft CRM connected to SharePoint allows you to search for CRM contacts from SharePoint
    2. TFS connected to SharePoint lets you see the project documents and reports via SharePoint
    3. Your roster system connected to SharePoint allows you to see those calendars in SharePoint
    In SharePoint 2010 – the Business Data Catalog is upgraded to the new Business Data Connectivity Service (BCS).
    1. It is a lot easier to plug-in
    2. Supports not just READ operations, but delete, update and create operations as well.
  40. Do you have uptime checks for your public sharepoint site?

    Any configuration settings, that you rely upon, must have a check so you get an email as soon as the problem arises. Eg.
    An anonymous access check - A web publishing site needs a check to make sure anonymous access is configured correctly.

    Figure: Enable anonymous access for publishing site
    Figure: monitors for anonymous access - If the monitor is down, there will be an email sending out to our network admins
  41. Do you know how to get the SharePoint document version in Word?

    We are always disappointed when adding version information to a Word document. When you use the Work version you get a number that indicates the number of times the document has been saved and not a proper version number.

    It is possible to get the number into Word for the version of the document on the SharePoint document library.

    Follow the guide here: http://www.bryansgeekspeak.com/2009/03/moss-2007-show-sharepoint-version.html

    Note: This also works in SharePoint 2010 and Office 2010.

    Figure: Good example, you see the formatted SharePoint version number
    Bad Example
    Good Example
  42. Do you turn off auto activation on farm and web application scope features?

    Each SharePoint packages contains features that can be targetted at various scopes. 

    You need to pay special attention when you are targetting the Web Application scope.

    The feature XML looks like this.

    <Feature Id="{GUID}" Title="WebApplicationConfiguration" Scope="WebApplication" Version="1.0.0.0" Hidden="FALSE" DefaultResourceFile="core" xmlns="http://schemas.microsoft.com/sharepoint/" >

      <ElementManifests />

    </Feature>  

     

     

     But there is a problem...

    The problem with this web application feature is that it will activate by default on All new Web Applications created on that farm, regardless of what the web application or root site template is.

    The best practice is to make sure you use the additional attribute ActivateOnDefault and set it to False.  Then SharePoint administrators can choose to activate the feature after a new web application is created.
     <Feature Id="{GUID}" Title="WebApplicationConfiguration" Scope="WebApplication" Version="1.0.0.0" Hidden="FALSE" DefaultResourceFile="core" xmlns="http://schemas.microsoft.com/sharepoint/
    ActivateOnDefault="False">

      <ElementManifests />

    </Feature>



  43. Do you know when to use BCS?

    If you want an easy way to access data in remote or legacy systems, provide one or more of the CRUD operations to the end users and search the data within the SharePoint search framework, then you should consider BCS. You can also use MS Office applications to access the data from SharePoint.

    However, BCS doesn't do everything.  It does not provide support for WorkFlow or EventReceivers on the list in SharePoint. 

    BCS is good for synchronising the data at SharePoint with one other system.  It is not suitable for publishing the data to multiple systems (i.e. syndication). If you need to implement syndication, use a standard SharePoint List and attach either a Workflow or an EventReceiver to handle sending updates to the end systems instead.




    Use BCS with multiple systems(not working)



    Use BCS with one system at time

  44. Do you avoid using BCS when you need Workflow?

    If you are planning to use Workflow, use Workflow with SharePoint List instead of BCS. Because Workflow cannot be associated directly with external lists. The reason is data is not stored in SharePoint, so the Workflow cannot be notified when items change.



    BCS doesn't have WorkFlow support



    Use WorkFlow with SharePoint List
  45. Do you turn off auto update on your servers?

    It is not a good idea to have Windows Update automatically updating your servers.  There are a few reasons.

    1. The hotfix could bring down a production environment. (This issue previously happened)
    2. In fact, even in a development environment this could be hours of lost work as the development team struggles to understand why only some of the developers' servers magically and mysteriously broke overnight.
    3. Windows Update could restart your server, or put your server in a state where it requires restarting - preventing any urgent MSI installs without bringing down the server.

    Windows Update remains the best thing for end-users to protect their systems.  But in a server, especially a production server environment - Windows Update patches are just like any new versions of the software that's built internally.  It should be tested and then deployed in a controlled manner.

    So recommendations:

    1. Windows Updates may be critical and should be kept relatively up to date.
    2. Have a plan where your awesome Network Admins schedule time to keep the servers up to date - including testing that the servers still perform its functions.
    3. Turn off Automatic Windows Update on Windows Servers
  46. Do you know how to format dates to include the weekday?


    Figure: Bad example - using the default Date Format


    Figure: Good example - using the Date Format with 'ddd'

    How do you do this ?
    By default, the date type column only have two format options:

          Figure: Date Format #1 Figure: Date Format #2
    To add the week day(eg.Wed) you need to:
    1. Select List Settings | Columns |Create column | Calculated (calculation based on other columns)
    2. See the columns of this list in the "Insert Column", add the column you want to change format, and custom the code in "Formula" like below:   
      Figure: Calculated column with Formula code
    3.  Change the views of the list to use the new Calculated column (WeekDate) instead of the original date column (Date): Figure: Replace the old Date column (Date) with new Calculated column (WeekDate It should not be this hard - see suggestion to the SharePoint team to make date formatting easier.
  47. Do you know what collaboration means?

    Among other things,​ it means never sending attachments in an email. Once an attachment is included in an email there are multiple copies of that attachment. If people change the contents of the attachment there is confusion about who holds the "master version" of that file.
    SharePoint changes this by allowing you to easily email a link to a SharePoint file. This means all recipients review and edit the single "master version" of the file.
    share-link1.jpg
    share-link2.jpg
    Figure: Good example: Email a link, not a file
  48. SharePoint Rules Categories - Do You Know How to Make the Title Consistent?

    When you want to update the Rule Title, please DO NOT update them in the list directly.
     Click the URL near it, navigate to the Rule Summary page, and edit the Rule Summary Page Title, it will automatically update:
    •  Rule Summary Page Title
    • Site Title
    • Item Title in RuleCategoryLookupData List
    Like this (thanks for Adam's snapshot) :

  49. Do you know that you can't use 2010 Managed Metadata with Office 2007 out of the box?

    SharePoint 2010 and Office 2010 ships with a fantastic document management feature "Managed Metadata Service". This new service provides first class support for enterprise taxonomy within a standard SharePoint 2010 environment.

    Unfortunately, Office 2007 and Office 2003 can't work with managed metadata fields out of the box.
      Office 2010:
    1. Works fine
      Office 2007:
    1. Document information can't display managed metadata
    2. You can still save documents to SharePoint
    3. But you can't check-in (if metadata fields are required)
    4. User needs to perform a web check-in
      Office 2003:
    1. Can't create new or Open documents with managed metadata
    2. Install Office 2007 document support upgrade, this bring the experience a bit better similar to Office 2007.
     
          

    Best Solution:

    Use a 3rd party solution - the best one being OnePlaceMail which provides a UI for managed metadata via the "Save to SharePoint". Works with all three versions of Office so users get a consistent UI.

    Figure: The optional save dialog that pops up when saving document to SharePoint - allowing use of Managed Metadata from Office 2003, 2007 and File Explorer
  50. Do you remove ‘My Site’ and ‘My Profile’ if you are not using them?

    My Site and My Profile are great but if you are not using them, it makes sense to remove them:
    Figure: Links need to be hidden
    You can follow below steps to hide “My Site” and “My Profile”,
    There are a few options, based on what you need to do:

    1. Delete the association (not recommended)

      a. Go to Central Admin | Application Management | Service Applications | Configure service application associations
      Choose “default” link:
      Figure: Choose “default” link

      b.Uncheck the “User Profile Service Application”  in the opened page, then click “OK”:
      Figure: uncheck the association for user profile service

    2. Customize permissions for only some people to have access to create personal site

      You can remove it for most people - but leave it for only some users.

      a.    Go to Central Admin | Application Management | Service Applications | Manage service applications,
      Click the link of “User Profile Service Application”, navigate to its manage page:

      Figure: “User Profile Service Application” manage page

      b.    Click People | Manage User Permissions, you can customize the user profile permission for specific users:
      Figure: Better - customize User profile permission

    3. Delete the service (recommended if you don't need the service at all in your farm)

      Note: You can always create it later if you need it in the future.

      Go to Central Admin | Application Management | Service Applications | Manage service applications,

      Select “User Profile Service Application”, then click the “Delete” button on the ribbon:
      Figure: Best - delete user profile service

    Note: Later on if you want to get My Site working read these 2 links… unless Microsoft creates a services that fixes User Profile Synchronization service…. thanks to Mark Rhodes for these tips…
    http://www.harbar.net/articles/sp2010ups2.aspx and http://www.harbar.net/articles/sp2010ups.aspx


  51. Do you know how to fix people's display name in SharePoint ?

    When SharePoint encounters a new person, it takes people's display name and account name from Active Directory, but sometimes
     Figure: Mixed up names - some are good Display Name, some are essentially just the Account Name (More here)
      The easiest way to fix this requires someone with central administration access:
    1. Go to: SharePoint Central Administration | Application Management | Service Applications | Manage Service applications
    2. Go to User Profile Service Application
    3. Go to Manage User Profiles
    4. Find the user profile that you want to update
    5. Fix the Name field (Display name)
       
    6. Save

    Better way
    The better way is to set up User Profile Synchronization and have SharePoint communicate with Active Directory on a schedule and keep user's profile information up to date. Unfortunately, it can be tricky to set this up in SharePoint 2010.

    Technical
    When a user is entered (or using) a SharePoint site, the site will first check with Central Admin (the farm) to enquire about this user's profile details. The farm grabs the account name and display name from Active Directory, but does not keep this synchronized.

    Unless configured otherwise, end users in SharePoint do not have the ability to modify their own display name. And the best place to update this is to either:

    1. Modify the farm user information list cache (via steps above), or
    2. Set up User Profile Synchronization
  52. Do you know this quick fix for SharePoint JavaScript errors that prevents you from switching page layout?

    Follow the step to fix SharePoint JavaScript errors:
    1. Your content editor is trying to change page layout via the Ribbon in SharePoint 2010
       Figure: Click Page Layout in the Ribbon
    2. But they get a JavaScript error

      Webpage error details

      User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)
      Timestamp: Wed, 22 Dec 2010 01:33:17 UTC

      Message: Object required
      Line: 2
      Char: 6422
      Code: 0
      URI:http://intranet.ssw.com.au/_layouts/cui.js?rev=wvoVpqlQb30nGo4DjDk8Kg%3D%3D

    This error is likely caused by SharePoint trying to render available page layouts for the page to switch to, but there is an error.

    A very quick fix that can be applied by a site owner is:
    1. Site Settings | Look and Feel | Page layouts and site templates 
    2. Restrict the valid number of page layouts that can be used, instead of allowing "Pages in this site can use any layout"Figure: Restrict valid page layouts
    3. This fixes the Ribbon menu
      Figure: Ribbon menu fixed!
    4. Tell your sys admin that there are broken packages in SharePoint and must be fixed ASAP
  53. Do you stop editing, when you see “Read Only”?

    When editing a .doc file in a SharePoint document library, you need to always “check Out” when you see “Read Only”. You need to “Check In” the document after editing to TFS.


    Check-Out when you see ReadOnly

    Figure: Warning - If you see “Read-Only” in the title bar, then you need to “Check Out”


    Click Check-Out to edit

    Figure: Click “Check Out” to edit the document in TFS

    Save before closing
    Figure: When you click “yes”, expect a 2nd dialog (for SharePoint controlled docs)

    Check - in after saving the changes
    Figure: Good – the dialog you should always get on saving

  54. Do you know the best way to implement administrators' login

    When administrators need different credentials to login to a SharePoint site, there are different ways to implement it.

    ​1. Obvious "Login" link for administrators:

    LoginLink.png

    Bad example: Obvious 'login' link for administrators

    2. Use little dot for a hidden link:

    HiddenDotLink.png
    Bad example: little dot for a hidden link

    3. Use /admin/ to let administrators to login (WordPress nearly got it right with /wp-admin/):

    AdminURL.png
    Good example: Use /admin/ URL for administrators

  55. ASP.NET vs SharePoint development - do you know what you get for free out of the box?

    SharePoint as a platform on top of ASP.NET gives you many components that you don’t get from ASP.NET out of the box:

    • WYSIWYG editing (IE only, no FireFox)
      SharePoint’s rich text editor works really well with IE out of the box, works with SharePoint image libraries, and supports many features and even allows site style configurations to define and restrict styles that can be applied in the site. Unfortunately, it is not a cross browser compliant WYSIWYG editor.
      In ASP.NET there are many 3rd party options here – but you won’t get the integrated support that SharePoint’s editor has, without doing further customization.
    • Content Version Control (with Publish and Approval workflow)
      SharePoint gives your end users content version control – they can update their pages and check-in to share it with the team, or publish it for everyone to see. Workflows can be attached to notify the necessary internal reviews.
      SharePoint also tracks changes across versions (except in web part zones), and allows users to compare between different versions.
      In ASP.NET this is not available – you will need to do significant work to achieve this behaviour, or build on top of another ASP.NET platform.
    • Permission Control (just assign to Groups)
      SharePoint allows items to be assigned to permission groups and works very well with Active Directory (or other membership providers) directly.
      In ASP.NET site permissions can be specified via web.config but the UI to configure parts of the site is limited.
    • Creating a subsite (simple and then appear in menus, breadcrumbs…)
      End users can create subsites in SharePoint that automatically appears in menu navigation and has all the correct breadcrumbs wired up. Subsites forms the necessary site navigation within SharePoint.
      In ASP.NET end users can not create subsites – developers has to do this.
    • Spell check
      SharePoint editor web parts come with spell check abilities.
      ASP.NET does not have equivalent – though many browsers now support a client-side spellchecking facility, and some 3rd party rich text editors also have spell check.
    • Search (filtered by your permissions) – google only works for anonymous
      SharePoint comes with a highly configurable enterprise search facility. The search result is filtered based on the current user so SharePoint will never show results that you aren’t supposed to see.
      SharePoint search can index Office documents as well as other popular document formats like PDF.
      Search engines like Google performs well for public content, but there is no way for the search crawler to index inside your organization. SharePoint uses its own internal crawler to keep your site’s content up to date in the search results.
    In ASP.NET - this is often overlooked – most ASP.NET search facilities are limited to only specific kind of data: e.g. search clients with the ID of SSW

  56. Do you know how to create a "Customer Portal" (in SharePoint)?

    ​You should do anything that helps a project succeed. The best thing is to enable great collaboration, by giving your customer an awesome 'Customer Portal'.  Then they can see new mockups, comment on features, get new releases and participate in team discussions on their particular project.

    So the first thing you should do is to create a 'Customer Portal' in your SharePoint extranet. Then give your customer a login, send them an email and they are now going to really get involved!

    There are many means by which you could provide this functionality to your client.

    If you are using SharePoint then....

    It is advised that you create a customized SharePoint Team Collaboration site template. That way you can very quickly initialize a new site, for each new customer.

    Once you have the template, follow these steps to create a customer portal with SharePoint 2007:

    1. Go to the root where you want to create a site. E.g. sharepoint.ssw.com.au
    2. Click "Site Actions" on right-hand top, select "Manage Content and Structure

     Manage Content and Structure

    Figure: The first step to creating a 'Customer Portal' is to select 'Manage Content and Structure' to view site collection

    Once the new window opens, on the left-hand side, click on the 'Clients' dropdown select New -> Site.
    Note: If you don’t see this option, that means you don’t have permission to create the site.

     Create New Site

    Figure: Create new site

    Now follow these steps when the new window opens fill in the fields below.

    Info to create site 

    Figure: Fill in the appropriate info then click "Create"

    More Information:

    1. Fill in the fields for the new client site
      eg. Title, Description, and URL
    2. Select the template
      e.g “ClientCollaboration_V1” in the Custom tab.
      Note: Your selection is confirmed in the picture. In this example, the template’s description looks like “Site for Collaboration with SSW Clients”.
    3. Select “Use Unique permissions” as you need to give the client an account to visit.
    4. In the “Navigation Inheritance” choose “No” as you don’t need to let client visit the other client sites via the navigation.
    5. Click “Create

     

    Next step is to setup the groups and permissions.

      Figure: Create a 'new group' or select an 'existing group' for the newly created site

    More Information:

    • Permissions: After you created the website for the client project, you need to configure the permission to make sure the developers and the clients can visit the site with the current authority. By default:
    1. Visitors to the site - Read:
      • Visitors need to read most of the site.
      • They can't read team discussions (not used)
      • They can download from 'release files' document library.
      • They can synchronize their calendar to the team calendar in SharePoint (not used - one day it should read from CRM)
    2. Members of this Site - Contribute:
      • Can view, add, update and delete.
    3. Owners of this Site - Full Control:
      • Has a full control.

    In this case, we are using 'create a new group' option because we want this group to be able to access only for this particular site  - It is a good practice to create a new group for every site you create, because it will be easier to add or delete users in the group for that specific site.

    Note: you can also access this through the "People and Group" option on "Site Action" link on right-hand top of the page if you need to manage permission in future.

    Click "OK", and the portal is created.

    Northwind Portal

    Figure: Northwind portal

    Note: SharePoint will send "welcome email" to all the members of the groups you created for the site with basic information, but you still need to send an email to your customer with the login details like URL, username, and password.

  57. Do you know how to custom styles for RichHtmlEditor in SharePoint 2013?

    ​​​​​​As a CMS system, it's obviously necessary to apply standard styles to all content, so the whole site looks consistent.


    This rule outlines how to use custom styles in the SharePoint  RichHTMLEditor​.


    In SharePoint, we can use the below way to apply custom styles:

    CustomStylesInSharePoint.png
    Figure: custom RichHtmlEditor styles give your content editors a visual preview of your custom styles​


    ​To do this:

    1. You can use "PrefixStyleSheet" property to apply the custom styles to a build-in RichHtmlField in page layout or master page. In my case, I applied them to a custom control "ParsedRichHtmlField" which inherited from the system build-in one.


    <SSW:ParsedRichHtmlField PrefixStyleSheet="ssw15-rte" CssClass="ssw-inputeditorfield" id="Content" FieldName="PublishingPageContent" InputFieldLabel="Rule Summary Info" runat="server"/>


    2. Refer an additional css file in the page layout or master page (apply to display mode content).

       <SharePointWebControls:CssRegistration ID="CssRegistration3"   Name="Themable/ssw.core.styles.v15.css" runat="server"  EnableCssTheming="True"

          />


    3. Refer the additional css file again in "edit mode" in the page layout or master page (apply to edit mode editor).

    <PublishingWebControls:EditModePanel ID="EditModePanel1" runat="server">

    <!-- Styles for edit mode only-->

    <SharePointWebControls:CssRegistration ID="CssRegistration2" name="<% $SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/editmode15.css %>"

     After="<% $SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/pagelayouts15.css %>" runat="server"/>

            <SharePointWebControls:CssRegistration ID="CssRegistration3"   Name="Themable/ssw.core.styles.v15.css" runat="server"  EnableCssTheming="True"

                 After="<%$SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/editmode15.css  %>" />

    </PublishingWebControls:EditModePanel>

    Use "After" property to ensure that it will be loaded after the "editmode15.css", which is SharePoint default edit mode style. The custom style css file will be applied to the ribbon after users change to edit mode.


    4. Add your custom styles definitions into the additional css file, all styles' names should start with the value you set for PrefixStyleSheet, in our case, it's "ssw15-rte". The custom styles can be applied to different areas (cases) in the ribbon.

    1) .ssw15-rteLanguage - As SharePoint support multiple language, this definition will tell SharePoint which language will use those custom styles.

    e.g.

    .ssw15-rteLanguage-en {

        -ms-name: English;

    }

    2) .ssw15-rteElement - tell SharePoint which element will be applied with this style. When you press "Enter" in SharePoint editor, it will automatically start a new paragraph with "<P></P>", so it's a brilliant choice to make some custom "paragraph" elements.

    e.g.

    P.ssw15-rteElement-CodeArea

    {

    -ms-name:"Code Area";

    border: solid #CCC;

    border-width: 1px 1px 1px 10px;

    background: #EEE;

    padding: 5px 10px;

    margin: 8px;

    overflow-x:auto;

    display:block;

    width:93%;

    font-size:12px;

    }

    This Code Area style will come up in "Page Elements" section:​

    CodeArea.png
    Figure: Code Area style come up in "Page Elements" seciton


    While applying a "Page Elements" style, it will


    • Remove all the styles for the children elements
    • It may change both the class name and the parent element type, it depends on which html element has been specified in the definition.

    For example, we change the style 

    from 

    P.ssw15-rteElement-CodeArea

    to

    dd.ssw15-rteElement-FigureGood


    Its html code will change 

    from

    page_element_p.png
    Figure: "Code Area style" with parent element <p>

    to

    page_element_dd.png
    Figure: "Good Figure style" changed the parent element from <p> to <dd>

    3).ssw15-rteStyle - this style could be applied to Text Styles:


    e.g.

    .ssw15-rteStyle-Highlight

    {

    -ms-name:"Highlight";

    background-color: #FFFF00;

    }

    This Highlight style will come up in "Text Styles" section:​

    HighLight.png
    Figure: Highlight style will come up in "Text Styles" section​

    While applying a "Text Styles" style, it will


    • nest the text in a <span> tag with the style class if the text is not already inside an HTML tag
    • replace the class of the HTML tag if this tag is a <span> tag


    That means all "Text Styles" will apply to <span> tag, and you cannot apply two "Text Styles" to one <span> (e.g. apply both Strike and Hightlight), you may have to do that via changing html source code manually, or creating a "combined" "Text Styles".


    4) .ssw15-rteTable - Tell SharePoint the definition of custom table styles. After inserting a table, you can see the styles under "Design" tab:​



    e.g. The below is a "SSW Table" style definition:

    .ssw15-rteTable-default

    {

    -ms-name:"SSW Table";

    border:1px solid #ddd;

    margin: 8px;

    width:98%;

    background-color:#f0f0f0;

    }


    After finishing the definitions of custom styles, make a package and deploy to a SharePoint site, Create a page using the page layout or master page which you added custom RichHtmlField style, then you should be able to see the custom styles in the ribbon.


    Enjoy!


  58. Do you know how to resolve the broken links caused by page renaming?

    ​​Renaming pages in SharePoint site will cause broken links. All requests to the old URL will be responded to ​with a 404 error.

    Options to resolve this issue are:

    • ​Add a page every time for a rename…. add a JavaScript or META tag redirect to the original page​
    • Use custom 404 page to look at a list in SharePoint, the list contains all the renaming records, the records are automatically maintained via page updating events handler. (We are using this way) 
    • Wait for MS to fix the problem - support classical alternative links for a page.​ 

     


     

  59. Do you know how to set up Application Insights (in SharePoint)?

    ​​ The best approach of setting up Application Insights in SharePoint is a bit different than adding to normal web application.

    (Note: To check the normal way of setting up Application Insights via Visual Studio, please read "How to set up Application Insights ")

    With a web application you are developing you have full control of web.config and have access to it in your Visual ​Studio project, and can follow "How to set up Application Insights " to set up Application Insights. This way Visual Studio will do all the modifications for you automatically.

    But when you develop on SharePoint, you do not have a full copy of web.config in your Visual Studio project, the web.config will be initialized on the SharePoint server when a new SharePoint site is created. This means Visual Studio cannot be used to update the web.config for you. Although you can modify SharePoint web.config via coding, that involves lots of development and testing work against your SharePoint server.

    The best process to implement Applications Insights in SharePoint can be split into two parts:

    1. Implement App Insight JavaScript in master page (via Visual Studio)  or web pages individually via embedded​ code, there are two good articles include the detail steps
    2. Use Application Insights Status Monitor configuration tool to add DLLs reference and update web.config​ (no coding work involved), there are two articles include the detail steps
  60. Do you know how to share a file/folder in SharePoint?

    You often need to share links to a file or folder in SharePoint. ​

    Instead of opening and ​copying it from the browser, you can open the menu on ellipsis link and get it from there:

    sharepoint-link.jpg
    Figure: Getting URL from SharePoint ellipsis menu

    Now, if you want a link to a file (won't work well for folders) you can always​ right click and copy it from the browser prompt:

    browser-link.jpg
    Figure: Getting a file URL from right click. The disadvantages are that it doesn't work fine for folder, and that you can't see the link before paste​
  61. Do you know how to sort in view by a column through code

    ​​​You may know that it is quite easy to sort view by a column through the UI.
    SortInView.png
    Figure: Change view column ​sort from web UI
    But when you are trying to do that via code, you may find a pretty tricky issue.
    You can use some code like:

    view.Query = "<OrderBy><FieldRef Name=\"Modified\" Ascending=\"FALSE\" /></OrderBy>";

    Figure: Use code to change view sort
    but the below code won't work:

    view.Query = "<OrderBy><FieldRef Name=\"Modified\" Ascending=\"False\" /></OrderBy>";

    Bad Example - the Ascending attribute is case-sensitive
    The full code should be some code ​like:

    SPView view = list.DefaultView;
    view.Query = "<OrderBy><FieldRef Name=\"Modified\" Ascending=\"FALSE\" /></OrderBy>";
    view.Update();​​​​

    ​Good Example - the Ascending attribute is using capital charactors as it is case-sensitive
                     
                        
                        

  62. Do you know the 6 ways to integrate your CRM 2011 data into SharePoint 2010?

    You have data in CRM 2011, so how do you see it in SharePoint? The data that is stored in CRM entities should be available in SharePoint so users can find and use the data in areas such as:

    - SharePoint search

    - SharePoint reporting (if you are using SQL Reporting Services in integrated mode)

    There are many ways to get to this data, let's go through them:

    OPTION 1: SharePoint BCS A​​dapter (provided by the CRM Team) RECOMMENDED

    This BCS Adapter for CRM 2011 is from the CRM team (It does all of the BCS work for you by interrogating the CRM metadata service).

    Summary: SharePoint BCS -> Pre-built Adapter (.NET Assembly) -> CRM web services - > CRM database

    Pros

    Cons

    clip_image002[8]Read/Write

    clip_image002[9]Minimal coding

    clip_image002[10]Easiest to implement

    clip_image002[11]The likely way forward (Best Practice as Microsoft)

    clip_image004[13]Needs to be deployed and published to the web server.

    clip_image004[14]Less performance than SQL filter views directly

    clip_image004[15]Only recently released.

    clip_image010 
    Figure: CRM data available in SharePoint

    More information:

    Download from Microsoft

    Read "Connecting to CRM Online 2011 with SharePoint 2010 Business Connectivity Services"

    Run tool to generate the XML mapping (.BDCM)

    This solution uses a BCS Connector – a .NET Assembly responsible for mapping external data into a form usable by SharePoint. This component is loaded and hosted within SharePoint 2010, and communicates with CRM via the CRM Proxy Service.


    Option 2: SQL Server Filtered Views

    CRM recommends that you *don't* read from the Tables, so they provide SQL Views for this purpose.

    Summary: SharePoint BCS -> CRM database

    Pros

    Cons

    clip_image002Easiest

    clip_image002[1]Best performance

    clip_image002[2]Codeless

    clip_image004Read-only

    clip_image004[1]Not available for hosted CRM

    clip_image004[2] Security issues as you are exposing the view.

    Filtered Views in Microsoft CRM provide access to the data available that supports providing picklist name and id values (lookup tables).

    More information:

    If you only want read-only for CRM on-premises data for SharePoint users, this solution is fine. You create the External Content Type directly against the Filtered Views in the CRM database. 

    http://msdn.microsoft.com/en-us/library/gg328467.aspx

    clip_image005 

    Figure: The result of “SELECT * FROM FilteredCtx_Project”. Use Office SharePoint Designer to hook this up.


    OPTION 3​: Web Services

    CRM provides web services.

    Summary: SharePoint BCS -> Code calling CRM web services - > CRM database​

    Pros

    Cons

    clip_image002[3]Read/Write

    clip_image004[3]Needs lots of code and test work.

    clip_image004[4]Needs to be deployed and published to the web server.

    clip_image004[5]Less performance than SQL filter views directly #1

    #1 Note: Performance could be improved by making the reads from the views and the writes through the web service

    More information: 

    1. Use BCS in VS 2010

    2. Write code that calls the CRM web services (that access the CRM data)

    3. Test

    4. Deploy


    OPTION 4​​: Expose OData from CRM as RSS

    The CRM 2011 OData Query Designer can be used to build queries to expose the data from CRM as RSS

    Pros

    Cons

    clip_image002[4]Easy configuration

    clip_image004[6]50 records limit. Need to page through the results.

    clip_image004[7]Possible issues with firewalls and proxies because it uses Integrated Security for authentication.

    clip_image004[8]Read-Only

    clip_image004[9]No easy way to consume


    Note: You can really only call the OData endpoint from an application that already has an authentication cookie with the CRM server.
    i.e. you can't impersonate and call it like you can the standard WCF endpoints
    So it is really only suited to calling from Silverlight and JavaScript web resources that are delivered inside CRM (because they have the cookie)

    More information:

    The first step is to expose the data:

    1. Install http://crm2011odatatool.codeplex.com

    2. Make a query

    clip_image006 

    Figure: Designing a query

    3. See the data

    /SoftwareDevelopment/rulestobettercrm/PublishingImages/figure3.jpg 

                    Figure: See the data - RSS source for xtc_countrySet

    The second step (and the problem) is consuming the data

    clip_image009 

    Figure: BCS has no option to consume RSS data. Please Microsoft SharePoint Team, we need a new 'Data Source Type' = OData

    In summary, CRM 2011 can exposes OData, but SharePoint 2010 BCS doesn't consume OData.

    The 3 options to consume the OData/RSS data:

    · Consume the OData by SQL Server, via TSQL ???    Then use BCS to call SQL Server.
    Summary: SharePoint BCS -> DataSourceType: SQL Server -> OData- > CRM database

    You would need to be crazy to go down this route http://www.vishalseth.com/post/2009/12/22/Call-a-webservice-from-TSQL-(Stored-Procedure)-using-MSXML.aspx

    · Consume the OData by a BCS adapter + code calling web services (same story as above).
    Summary: SharePoint BCS -> code calling OData- > CRM database

    · Consume the RSS by "SharePoint RSS view web part" directly.
    Summary: SharePoint RSS view web part -> OData- > CRM database
    (not recommended as it could not be used in "SharePoint Search")

    So OData is all things horrible because it is hard to eat :-(


    OPTION 5: BizTalk​

    Biztalk is built for mapping systems together, unfortunately this solution is only considered for large enterprises.

    Summary: SharePoint BCS -> BizTalk Database - > CRM database

    Pros

    Cons

    clip_image002[5]Read/Write

    clip_image002[6]The BizTalk data centre can also provide data for any system.

    clip_image002[7]Requires little code if users already have BizTalk

    clip_image004[10]BizTalk :-)

    clip_image004[11]Deployment - Needs external work to deploy BizTalk server.

    clip_image004[12]Licence Cost



    Option 6: OData 3rd Party solutions (doesn't exist)

    Today SharePoint 2010 exposes lists and document libraries as OData, but does not natively consume OData.

    What does this mean?

    - CRM 2011 exposes it data as OData, but cannot consume OData

    - SharePoint 2010 exposes it data as OData, but cannot consume OData

    ....and there are no 3rd party solutions to solve this...

  63. Do you reduce diagnostic logging level after configure hybrid search?

    By default, SharePoint diagnostic logging level was set to “Information” and “Medium”, which will log quite a big info, and it increased a log after configuring “hybrid search”:
    ​​​
    sp-diagnostic-logging.jpg
    Figure: default logging levels​
    sp-diagnostic-logging-2.jpg
    Figure: lots of "Medium" level search logs
    This made us had 60GB logs for only 14 days.

    So the solution is to change to "diagnostic logging level" as below to reduce the log size:​

    sp-diagnostic-logging-3.jpg
  64. Do you use the right service in SharePoint 2013

    ​​​In SharePoint 2010, you can use SharePoint service /_vti_bin/listdata.svc to access data in SharePoint list, but in SharePoint 2013, /_vti_bin/listdata.svc has been officially deprecated.

    The new service in SharePoint 2013 is http://server/site/_api/web/lists/getbytitle('listname')​
  65. Never Dispose Objects from SPContext.Current

    ​Disposing objects in SharePoint is important, but never do it with objects from SPContext.Current. SharePoint will manage disposing these objects itself.​

    using (SPWeb web = SPContext.Current.Site.RootWeb)
    {
     //do something here
    }

    Figure: Using statement is trying to dispose current site object - it will cause exception

    Just simplely use "Current" object directly.

    SPWeb web = SPContext.Current.Site.R​ootWeb​;
    //do something here

    Figure: Use Current objects directly - don't need to dispose them