SharePoint: Getting “This collection already contains an address with scheme http” Error When Creating a Custom WCF Service

Tuesday, April 23, 2013

Problem: The problem is caused by the fact that IIS supports specifying multiple IIS bindings per site (which results in multiple base addresses per scheme, in our case HTTP), but a WCF service hosted under a site allows binding to only one base address per scheme. Multiple addresses example (in our case two): Solution: Create a custom service factory to intercept and remove the additional unwanted base addresses that IIS was providing. A) Add the custom service factory to your Custom.svc file   <%@ServiceHost language=c# Debug="true" Service="MySolution.Services.CustomService, $SharePoint.Project.AssemblyFullName$" Factory="MySolution.Core.CustomHostFactory", $SharePoint.Project.AssemblyFullName$ %> * Don’t forget to add the assembly full name: $SharePoint.Project.AssemblyFullName$ or you’ll get “The CLR Type...
no comments

Getting “Your query is malformed.Please rephrase your query” Error When Using FQL Query Keyword With Double Quotes

Thursday, April 11, 2013

When trying to use FQL (Fast Query Language) query keyword with double quotes, for example: body: string(“”hello world””, mode=”and”) You’ll get “Your query is malformed.Please rephrase your query” Error.  Since FQL has a problem with double quotes, the trick is to use backslash (\) in front of the quotes,  for example: body: string(“\”hello world\””, mode=”and”) Hope this trick was helpful for you as it was for me.
no comments

SharePoint: Can’t Activate Site Collection Feature When Creating New Site From a Custom Web Template.

Saturday, March 30, 2013

The onet.xml file is basically divided into two parts, first is the "SiteFeatures" element and the second element called "WebFeatures". The "SiteFeatures" Section that holds the site features starts activating all the features only when creating a site collection. The "WebFeatures" Section that holds the web features starts activating all the web scoped features only when creating a site. Scenario: you created a custom web template, deployed the solution and when trying to create a site from you custom web template you get the following error "the site template requires that the feature {GUID} be activated in the site...
no comments

How To Create Custom Search Engine For SharePoint 2013 In Google Chrome

Tuesday, January 1, 2013

A great way to search something on your SharePoint 2013 site or any older version of SharePoint without the need of browsing to the site and start writing your search query cause Google Custom Search is doing it for you. Steps for Adding a Custom Search Engine A) Right click mouse on the address bar and choose “Edit Search Engine” B) You will need to fill 3 text boxes.  Add a new search engine – the name of the search engine, by default, Google Chrome uses the site’s domain name Keyword – use a Keyword that will be easy to remember like “SP” or...

SharePoint Control Overrides My JavaScript “Keypress” Event

Monday, December 3, 2012

When you want to bind an event handler to the "keypress" JavaScript event, or trigger that event on an element, you can achieve this using JQuery  handler like .keypress( handler(eventObject) ) . For example, binding "keypress" event to a text box on your custom control : $("#input").keypress(function (event) { var code = (event.keyCode ? event.keyCode : event.which); if(code == 13) //Enter keycode // your logic here... } });   As you can see, the task is very simple and straightforward, but when dealing with SharePoint , sometimes things get pretty messy. Scenario:  You developed a custom control with a text box and used a "keypress" JavaScript event...

SharePoint: Getting Authentication Login Prompt When Trying To Open Office Document With Unique Permissions

Tuesday, November 6, 2012

The problem is in opening an Office document which is saved in SharePoint 2010: When a user has a "read" permission only to a specific document in a document library, but do not have any permissions in the document library level nor the site level. When he is accessing the document, he receives the "Download File" message with "Open" / "Save" / "Cancel" options. When clicking "Open", he is prompted with a user & password message. When clicking his correct user and password, the user & password message remains – nothing happens. Only when clicking "Cancel" in the user &...

How To Create A Windows 8 App For SharePoint Part 2 – The Development Stage

Sunday, September 30, 2012

  The Development Stage In my last post How To Create A Windows 8 App For SharePoint Part 1 – The Planning Stage we discussed about the reason I chose Windows 8 HTML5 as my development environment and why it’s the best and the most intuitive environment for SharePoint developers who plan to start creating Win8 apps. Today we will focus on developing our Win8 app and integrate it with SharePoint Online 2013. The app will serve as a search and use The new Search REST API to pull data from SharePoint 2013 Search engine (FAST) and display it in our app....

How To Create A Windows 8 App For SharePoint Part 1 – The Planning Stage

Saturday, September 15, 2012

The Planning Stage There’s a big buzz going on around Windows 8 app development, In my earlier post “Create a Metro Live Tile using MetroJS, JsRender and the new REST API” I showed how to create a metro live tile using html and JavaScript and today we continue exploring this subject area and create Windows 8 app that interacts with SharePoint. We will focus on Windows 8 HTML5 app, There are 4 main reasons why I chose to use HTML5 development in this example. A) SharePoint developers will feel much more comfortable around JavaScript and HTML rather then in XAML development. B) Leverage...

SharePoint: Save Site As Template Common Errors/Mistakes

Tuesday, September 4, 2012

Hi guys, I’ll try to explain couple of common mistakes/errors made when trying to save a site as site template. 1) Save publishing site as site template. The Problem Common mistake is made when trying to save publishing site as site template , There is a  good reason why this publishing template is not supported and does not include the ‘Save as Template’ link, There is a workaround to enable this feature as explained in this post. It maybe a quick solution but in the long run this solution is very problematic when later trying to upgrade the site templates generated from this...