All posts in Development

Bad Request returned when creating a new site via SharePoint Designer Workflow

So recently I was trying to create a workflow to automatically provision a new web when all criteria was met.  For some reason whenever the WF got to the provisioning step it failed with a Bad Request, plus it choked trying to display the responseContent from the call.  All the settings looked correct (or so I thought).  Taking a look at the ULS logs I was getting the following:

Microsoft.Data.OData.ODataException: The property ‘_metadata’ does not exist on type ‘SP.WebInfoCreationInformation’. Make sure to only use property names that are defined by the type.

So I banged my head a while on this until I finally noticed something.  The metadata value in the request body is supposed to be a double underscore.  ‘_’ and ‘__’ look very similar at the start of a variable.  So if you are ever working on REST calls and come across something like this, take a look at that silly double underscore.

BTW, a great site for setting up workflow site provisioning can be found here.

Hope this helps someone with the same issue I had.

Playing Outside your Sandbox (Part 2) – SharePoint BCS Features by Version

In this post we will discuss the different features that are available to you within your SharePoint environment.  The information I am providing will be based on SharePoint 2013, but unless I specifically state the features are new to SP2013 you can assume they exist in SP 2010 as well.

Click here for part 1 of this series

SharePoint Foundation

Although this is the free and most basic version of SharePoint you actually get some great features from BCS.  Many environments are more than capable of fully utilizing everything they could possibly need with just the foundation version of SharePoint.

External Content Types

The External Content type is the heart of BCS.  99.9% of everything you do with BCS starts with an External Content Type (ECT).  ECTs basically act as the connection between SharePoint and the external data.  An ECT maps all the data within the external source that you want to bring into SharePoint.  I say that you want because even if you hit a data source with 25+ columns and you want 3, then you only have to bring in 3.  The ECT then maps all the connections, and configuration of the data from the external data source to objects within SharePoint.  The ECT in the end is really just a content type which contains columns that just happen to get their data from a source outside of your SharePoint farm.

Read more

Playing Outside Your Sandbox – Connecting SharePoint to External Data Sources (Part 1)

Business Connectivity Services (BCS) in my opinion is one of SharePoint’s most powerful, yet most under-utilized services.  Let’s think about this for a second.  If you are building a .NET app that needs to connect to an external database you need to create the connections to it and the basic CRUD methods into your data layer (you better be using a separate data layer or get off my blog ;-p  ).  Yes I know there are lots of code out there that will generate it for you, or you could just build your own.

But what if I told you that you could do it all with your already existing SharePoint environment and in a lot of cases without writing a single line of code.  Now before you developers get out your torches and pitchforks (remember I am one of you), let me assure you, for the more complex data connections you will still need to write code.  You will need to be able to write the code that can access, update and insert the data properly.  All I am saying is that for simple to moderately difficult data operations you can do it within SharePoint without writing any code.  Perhaps this means you could delegate some of this to the non-developers on your SharePoint support team so you only get the fun development work.

Read more