Adding a Service Reference to the SharePoint 2013 REST API

Some time ago I wrote a post describing my issues trying to add a service reference to the SharePoint 2013 REST API. I’ve done some more investigation since then and I have some additional information.


First off, I talked with my friend Paul Schaeflein who wrote a great blog post on how to use the REST API service proxy. I asked Paul if he’d had any issues creating the service proxy and he said he hadn’t. This baffled me until I realized that he had been targeting an on-prem farm while I had been targeting SharePoint Online. I went to one of my VM’s that had SharePoint 2013 SP1 on it, attempted to add the service reference and it worked like a charm. So it seems that the issues I was experiencing were specific to SharePoint Online. The remainder of this post applies to SharePoint Online only.


In my previous post I said that the service reference dialog automatically adds ‘/_vti_bin/ListData.svc’ to the URL for SharePoint sites and this was why Visual Studio could not add the service reference. I was mistaken.


The service reference dialog does make requests with ‘/_vti_bin/ListData.svc’ appended to the URL. But if these calls fail, it also makes requests to the URL you entered in the dialog. What it doesn’t seem to do, at least in the case of SharePoint Online, is send authentication information with the call. We can see this calling pattern in the following Fiddler trace.


Capture 


We can use Fiddler to prove that the missing authentication information is the problem. I made a request to get the service metadata in the browser and then dragged that request over the Composer in Fiddler. I then copied the Cookies (which contain the authentication information) to the clipboard.


Capture


Then, with Fiddler still running,  I made the request to add the service reference in Visual Studio. I took the first failed request to the correct URL and dragged it over into the Composer.


Capture


Finally I pasted the cookies from the clipboard into the Composer, pressed Execute and viola, I received the service metadata from SharePoint Online!


Capture


Capture


I’ve added an entry to the Office 365 Developer UserVoice regarding this issue. Please feel free to go and vote or comment.

SharePoint Fest New York–June 18 to 20


Next week I’ll be presenting a workshop and two breakout sessions at SharePoint Fest in New York City.


WS 202 – JavaScript and JQuery for SharePoint Developers
If you’re a SharePoint developer you are either doing JavaScript development now or you will be doing JavaScript development in the near future. There has been an increased focus on client-side development with each of the recent versions of SharePoint and now, with the introduction of the SharePoint 2013 App model, understanding client-side development is a must. This half-day workshop is designed to help you get started writing effective client-side code on the SharePoint platform. We will begin with a look at the JavaScript language, comparing and contrasting it to the server-side languages you already know. We will also take a look at jQuery, an extremely popular JavaScript library that simplifies interaction with user interface elements. Once the foundational material is complete we examine how to deploy, reference and use JavaScript code in SharePoint solutions and apps. The demonstrations in this section will focus on illustrating suggested practices that will make your code more readable, maintainable and less error prone.


DEV 101 – SharePoint 2010/2013 for ASP.NET Developers
SharePoint is an awesome tool. It allows you to build web sites, manage lists of data, collaborate on documents, and so much more – all done through a simple, easy to use, web interface. Even better, SharePoint is built on top of ASP.NET. So, when the platform doesn’t have the functionality you need, you can extend it using the tools in Visual Studio and the SharePoint developer APIs. Unfortunately it’s not all wine and roses. In addition to your ASP.NET development experience you’ll need to learn SharePoint specific concepts, practices and terminology. This session is covers the SharePoint architecture, developer tools, APIs, and the different packaging and deployment models. Its goal is to give you enough to get started developing on the SharePoint platform while laying the foundation for further learning on the subject.


DEV 202 – Integrating SharePoint 2010/2013 and Visual Studio Lightswitch
Visual Studio LightSwitch is a tool that’s designed to let power users build data-centric business applications for the desktop and cloud. The tooling takes care of code generation, data access and common infrastructure needs, allowing the application builder to focus on business logic. If enhanced functionality is required, developers can extend the application with custom .NET code. In terms of data access, LightSwitch applications can use many data sources, including SharePoint 2010 or 2013. In this class, you’ll see how to build client, Web, and mobile LightSwitch applications that use data from SharePoint. You’ll also see how you can use LightSwitch to build SharePoint 2013 Apps.


If you’re in the New York area come on out and let’s connect and talk SharePoint development. There are lots of registration options, you can attend for one, two, or all three days. Use code WINDSOR100 when you register to get a discount.

REST API Metadata Now Exposed by Sites in SharePoint Online

I was sitting in on one of Andrew Connell’s talks this week and he mentioned that the REST API for most SharePoint Online sites now exposes metadata. I immediately went to my SharePoint Online site, added /_vti_bin/Client.svc/$metadata to the site URL and, lo and behold, it worked!


image


What follows is the tale of my adventure trying to create a client that uses this metadata to build a service proxy. I started by opening up Visual Studio 2012 to create a Console Application project and trying to add a service reference. It didn’t work:


image


I clicked the Details link to see what the issue was and got, “There was an error downloading ‘https://robwindsor2.sharepoint.com/sites/dev/_vti_bin/client.svc/_vti_bin/ListData.svc/$metadata’”.  Look at the URL in that error message closely. What is /_vti_bin/ListData.svc doing in there – I didn’t add it. Well it appears that when you add a service reference in either Visual Studio 2012 or Visual Studio 2013, the dialog automatically adds /_vti_bin/ListData.svc to the URL for SharePoint sites. That was quite a bummer, it looked like I was going to have to resort to using DataSvcUtil on the command line to create the service proxy.


So I opened a Visual Studio Command Prompt and entered DataSvcUtil /out:SPProxy.cs /uri:https://robwindsor2.sharepoint.com/sites/dev/_vti_bin/client.svc. The call failed with the message, “error 7001: The remote server returned an error: (500) Internal Server Error”. I wanted some more information so I started up Fiddler and tried to create the proxy again. Taking a look at the body of the response I saw that the actual error message was, “Access denied. You do not have permission to perform this action or access this resource”. So I went to Google to see how to add credentials to the call being made by DataSvcUtil but it appears that you can’t. Many answers suggested that you download the metadata from a request in the browser and use the resulting file as input to DataSvcUtil so I did just that.


I downloaded the metadata to a file named metadata.edmx and tried to create the proxy again using  DataSvcUtil /out:SPProxy.cs /in:metadata.edmx. No luck – this time the error was, “error 7001: The element ‘DataService’ has an attribute ‘DataServiceVersion’ with an unrecognized version ’3.0′. Some more Googling suggested that I needed to download the most recent WCF Data Service tools from Microsoft (http://www.microsoft.com/en-ca/download/details.aspx?id=39373). I downloaded the tools and installed them but to no avail, running DataSvcUtil again gave me the same error.


At this point I gave up for a while but then it hit me. I had the metadata in a file on disk, why don’t I create another service that returns it and then use that service to create the proxy in my Console Application. So, I created a new project using the Empty ASP.NET Web Application template. I added a Generic Handler named Handler1 (I know, I’m creative that way, it’s a gift) and modified the ProcessRequest method as follows:


public void ProcessRequest(HttpContext context)
{
    var xml = File.ReadAllText(@"C:\temp\metadata.edmx");
    context.Response.ContentType = "application/xml";
    context.Response.Write(xml);
}

I started the project and navigated to http://localhost:port
/Handler1.ashx to ensure I got back the metadata, and I did. So, leaving the ASP.NET project running I opened another instance of Visual Studio, created a Console Application and added a service reference for the handler. It worked, I now had a proxy!


Now this isn’t just any old proxy – this is a PROXY! Five namespaces and about a billion types in this sucker. That made finding the context class a little difficult but after some time in the Object Browser and some educated guesses I finally found it. Now to write a LINQ query to get some list data. Here’s what I started out with:


private const string _siteUrl = "https://robwindsor2.sharepoint.com/sites/dev";

static void Main(string[] args)
{
    var context = new SPProxy.SP.Data.ListData(new Uri(_siteUrl + "/_vti_bin/client.svc"));

    var items = from p in context.ProductsListItems
                where p.Category.Title == "Produce"
                select p;

    foreach (var item in items)
    {
        Console.WriteLine(item.Title);
    }
}

I didn’t try to run to run yet because I knew I needed to add credentials. My first thought was to use the SharePointOnlineCredentials class the way I have in the past with the Client Object Model:


private const string _siteUrl = "https://robwindsor2.sharepoint.com/sites/dev";

static void Main(string[] args)
{
    // Credentials is a class I created to hide my user name and password
    var loginName = Credentials.Login;    
    var password = Credentials.Password;  

    var securePassword = new SecureString();
    password.ToCharArray().ToList().ForEach(c => securePassword.AppendChar(c));
    var creds = new SharePointOnlineCredentials(loginName, securePassword);

    var context = new SPProxy.SP.Data.ListData(new Uri(_siteUrl + "/_vti_bin/client.svc"));
    context.Credentials = creds;

    var items = from p in context.ProductsListItems
                where p.Category.Title == "Produce"
                select p;

    foreach (var item in items)
    {
        Console.WriteLine(item.Title);
    }
}

I ran Fiddler and then ran my program and it failed. Going to Fiddler I saw that the message was, “Access denied. You do not have permission to perform this action or access this resource”. I knew the credential information needed to be passed in a cookie when using the REST API but when I checked the request in Fiddler I saw there were none. So, after a little bit more Googling I found that you use the SendingRequest2 event on the context object to set the cookie. Some quick changes to the code resulted in this:


private const string _siteUrl = "https://robwindsor2.sharepoint.com/sites/dev";
private static string _authCookie;

static void Main(string[] args)
{
    // Credentials is a class I created to hide my user name and password
    var loginName = Credentials.Login;
    var password = Credentials.Password;

    var securePassword = new SecureString();
    password.ToCharArray().ToList().ForEach(c => securePassword.AppendChar(c));
    var creds = new SharePointOnlineCredentials(loginName, securePassword);
    _authCookie = creds.GetAuthenticationCookie(new Uri(_siteUrl));

    var context = new SPProxy.SP.Data.ListData(new Uri(_siteUrl + "/_vti_bin/client.svc"));
    context.SendingRequest2 += context_SendingRequest2;

    var items = from p in context.ProductsListItems
                where p.Category.Title == "Produce"
                select p;

    foreach (var item in items)
    {
        Console.WriteLine(item.Title);
    }
}

static void context_SendingRequest2(object sender, System.Data.Services.Client.SendingRequest2EventArgs e)
{
    e.RequestMessage.SetHeader("Cookie", _authCookie);
}



I ran my console application again and what to my wondering eyes should appear:


image


Success! At least the first stage of it. Stay tuned for more.

Walktrough: Building a Site Page in SharePoint 2010 or 2013

Let’s start with a brief description of Site Pages from MSDN:


Site pages are provisioned from a template page that is stored on the file system of the front-end Web server. When a site is provisioned, SharePoint Foundation creates a pointer to the instance of the page template on the file system. This allows SharePoint Foundation to avoid repeatedly creating copies of the pages, which are provisioned each time a site is created. When a user customizes a site page, the template for the page is then stored in the content database. The page is retrieved from the content database every time it is requested by a user. A customized page can, however, be reset to the original template page through the Web browser or a tool such as SharePoint Designer.


To paraphrase, we are going to create an ASPX page that will be deployed to the SharePoint system folders – this is the page template. Then, we will use a Module element to provision page instances into a SharePoint site (i.e. the SharePoint content database). Once a page instance has been added to a site, an end user can modify the markup of the page using SharePoint Designer. Because end users can modify the markup, inline code is not allowed in Site Pages.


Let’s Get Started


I show something similar to the following in my SharePoint 2010 Fundamentals course on Pluralsight but that demo is broken into two pieces and some find it a little hard to follow. This walkthrough shows the full process from end-to-end. The steps work the same in both Visual Studio 2010 or 2012 and targeting both SharePoint 2010 and 2013. I’ll be using Visual Studio 2010 and targeting SharePoint 2010.


Update: I’ve uploaded a video version of this walthrough to YouTube. The video is embedded at the bottom of this post.


Creating the Project


  • In Visual Studio, click File | New | Project…
  • In the New Project dialog, select the Visual C# > SharePoint > 2010 node under Installed Templates.
  • Select the Empty SharePoint Project template, set the Name to SitePageDemo and click OK.

image


  • In the SharePoint Customization Wizard, enter the site you want to use for debugging, select Deploy as a farm solution, and click Finish.

image


Adding the Site Page


  • In the Solution Explorer, right-click on the project and select Add | New Item and select Application Page. Leave the default name and click Add. We don’t actually need this page but we can use the generated markup.

image


  • In the Solution Explorer, right-click on the project and select Add | New Item and select Module. Set the name to SitePages and click Add.

image


  • In the Solution Explorer, right-click on the Sample.txt file under SitePages and select Rename. Change the name of the file to MyPageTemplate.aspx. You can ignore the warning about changing the file extension.
  • Open or switch to ApplicationPage1.aspx and copy all of the markup in the page to the clipboard
  • Open or switch to MyPageTemplate.aspx, remove any text currently in the file, and then paste the contents of the clipboard into the file

image


As mentioned previously, Site Pages do not support inline C# or VB code. So we need to modify the markup to remove any indication that we might be trying to do so. If we don’t, SharePoint’s Safe Mode Parser will throw an exception when we try to load the page.


  • Remove the Import directives at lines 2 and 6
  • Change the Page directive to the following

<%@ Page Inherits="SitePageDemo.SitePages.MyPageTemplate" MasterPageFile="~masterurl/default.master" %>

  • Add a Button and a Label to the Main content. You will likely need to close and re-open the file to be able to use the Toolbox.
  • Change the text in the PageTitle content to My Site Page
  • Remove the PageTitleInTitleArea Content Control

The complete page markup should now look like the following:


<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Inherits="SitePageDemo.SitePages.MyPageTemplate" MasterPageFile="~masterurl/default.master" %>

<asp:Content id="PageHead" runat="server" contentplaceholderid="PlaceHolderAdditionalPageHead">

</asp:Content>

<asp:content id="Main" runat="server" contentplaceholderid="PlaceHolderMain">
    <asp:Button id="Button1" runat="server" text="Button" />
    <br />
    <br />
    <asp:Label id="Label1" runat="server" text="Label"></asp:button>  
</asp:content>

<asp:Content id="PageTitle" runat="server" contentplaceholderid="PlaceHolderPageTitle">
My Site Page
</asp:Content>

Adding the Code-Behind


When building a Site Page we need to use true code-behind, not the code-beside we’ve been using since ASP.NET 2.0. We are going to need to add the code for the event handlers plus add all the code that would normally be generated by the WebForms designer. The class we are about to create is “linked” to the markup by the Inherits attribute of the Page directive.


  • In the Solution Explorer, right-click on the project and select Add | Class. Set the name to MyPageTemplate.cs and click Add.

image


  • Add Using statements for System.Web.UI and System.Web.UI.webControls
  • Make the class public and have it inherit from System.Web.UI.Page
  • Create protected fields (i.e. class-level variables) for the Button and Label that we added in the markup of the page. The variable names in the code must match the ID attributes of the controls in the markup.
  • Add an event handler for Page_Init. We will attach control event handlers here.
  • Inside Page_Init, register an event handler for the Click event of the button.
  • In the Click event handler, set the Text property of the Label to the current time

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SitePageDemo.SitePages
{
    public class MyPageTemplate : Page
    {
        protected Button button1;
        protected Label label1;

        protected void Page_Init(object sender, EventArgs e)
        {
            button1.Click += new EventHandler(Button_Click);
        }

        protected void Button_Click(object sender, EventArgs e)
        {
            label1.Text = System.DateTime.Now.ToLongTimeString();
        }
    }
}

Provisioning the Page Instance


We’ve just finished the page template, now we need to provision the page instance. One of the files that was created when we added the SitePages Module was an element manifest. This file (elements.xml) contains the instructions that will provision the page instance. In it we will tell SharePoint to copy the template into a folder names SitePages and using the file name MyPage.aspx. We’ll also indicate that this page can be customized by end-users by setting the Type to Ghostable.


  • Open or switch to elements.xml and update the attributes of the File element to look like the following: 

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="SitePages">
    <File Path="SitePages\MyPageTemplate.aspx" Url="SitePages/MyPage.aspx" Type="Ghostable" />
  </Module>
</Elements>

Feature


We want to ensure that the Feature that contains the SitePages module has a meaningful title.


  • In the Solution Explorer, double-click on Feature1 to open the Feature Designer
  • Change the Title to Add Custom Site Pages

image


Safe Control Entry


I mentioned the Safe Mode Parser previously. In addition to checking for inline code it will also check to see if the class that implements the code-behind for the site page has been marked as safe to execute. We indicate a class is safe to execute by adding a Safe Control entry into the Web.config file for the SharePoint Web Application. This seems like it might be tricky but it’s actually quite easy, the solution package deployment mechanism does most of the hard work for us.


  • In the Solution Explorer, select the SitePages folder
  • In the Properties Window, select the Safe Control Entries property. A button with an ellipses should appear.
  • Click the ellipses button to open the Safe Control Entries dialog
  • Click the Add button in the bottom-left of the dialog to add a new Safe Control Entry
  • Change the Type Name property to MyPageTemplate (i.e. the name of the class that implements to code-behind for the page)
  • Click OK to close the Safe Control Entries dialog 

image


Cleanup


We no longer need the Application Page we created earlier so we can delete it along the with its associated folders.


  • In the Solution Explorer, right-click on the Layouts folder and select Delete. We want to delete this folder and its contents so click OK when the confirmation dialogs shows.

Deploy and Test


We are now ready to test our work.


  • In the Solution Explorer, right-click on the project and select Deploy. This creates and deploys the solution package to SharePoint. By default, deploying from Visual Studio also activates the Feature that provisions an instance of our page.
  • Navigate to the SharePoint site you are using for testing
  • Add SitePages/MyPage.aspx to the site URL and press Enter
  • Click the button on the page and the label should show the current time

image


[View: http://www.youtube.com/watch?v=aWtE9HBrqBI]

Upcoming Pluralsight Course: SharePoint 2013 Development with the Client Object Model and REST API

Next Tuesday (May 28) my newest Pluralsight course will drop. It’s a 6.5 hour epic journey through the world of SharePoint 2013 Development using the Client Object Model and REST API. Here’s the module (chapter) breakdown.


Module 1: Introduction
- Introducing the Client Object Model
- Introducing the REST API


Module 2: Programming with the Client Object Model
- Using Load and Include
- Nesting includes
- Retrieving list items
- Data-binding
- Creating a list
- Batch exception handling
- Adding and updating list items
- Using Web Proxy
- Communicating from an App Web to the Host Web


Module 3: Programming with the REST API
- OData queries
- Using expand
- Data-binding
- Creating a list
- Creating list items
- Updating list items
- Using Web Proxy
- Communicating from an App Web to the Host Web
- Continuations


Module 4: Working with Documents and Document Libraries
- Creating a custom document library
- Uploading documents


Module 5: Working with Managed Metadata
- Creating terms and term sets
- Adding taxonomy fields
- Setting taxonomy field values


Module 6: Working with Users
- Checking user permissions
- Getting user profile properties


Module 7: Working with Search
- Keyword queries


Module 8: JavaScript in Solutions
- JavaScript in farm solutions
- JavaScript in sandbox solutions


Module 9: Working with “Legacy” Services
- Custom WCF services
- SOAP (ASMX) Web services
- SharePoint 2010 REST API (ListData.svc)


If you see the course feel free to comment if you have questions or feedback

SharePoint Dev Quick Tip – Quickly and Easily Building SharePoint REST API Query URLs

Have you ever tried to build the URL for a REST API service call and ended up confused and frustrated? The OData query syntax is well documented, it’s just not that intuitive. Well, if you want to query list data I have a little trick you can use to have the appropriate URL generated for you. Unfortunately this trick doesn’t work with the SharePoint 2013 _api service since it doesn’t expose metadata.


Step 1:
Create a Console application and add a Service Reference to the ListData.svc service for your SharePoint site. I set the Namespace to DemoProxy in my example.


Capture


Step 2:
Inside the Main method, create an instance of the data context and attach the default credentials.


var context = new DemoProxy.DemoDataContext(new Uri("http://win7virtualbox/sites/demo/_vti_bin/ListData.svc/"));
context.Credentials = System.Net.CredentialCache.DefaultCredentials;

Step 3:

Write a LINQ query that retrieves the data you want. My site has some data I brought over from Northwind so I’ll use that.


var products = from product in context.Products
                where product.UnitsInStock > 0 &&
                product.Category.Title == "Condiments"
                orderby product.UnitPrice
                select product;

Step 4:

Run your program in debug mode and use the data tip or the locals windows to get the generated query. You could also use Fiddler for this.


Capture


And viola, in a minute or two you have the query you want. For me it looked like this:


/_vti_bin/ListData.svc/Products()?$filter=(UnitsInStock gt 0) and (Category/Title eq 'Condiments')&$orderby=UnitPrice

This tip and much more can be found in my SharePoint 2010 Lists and Libraries for Developers course on Pluralsight.


[View: http://www.youtube.com/watch?v=dvFbVPDQYyk]

My Thoughts on the Developer Content at the SharePoint Conference 2012 (The Appy Hour)

Another SharePoint Conference has come and gone and it’s time for the obligatory wrap-up post (at least what I can remember). This was a very busy conference for me, almost to the point of being overwhelming. I caught some sessions live and got to spend time with my colleagues from Portal and Pluralsight, but I didn’t get nearly enough time to spend with the seemingly endless number of other people I knew at the conference.


Being an MVP, I had early access to the beta/preview bits and to training so I came into the conference with a solid understanding of the App model. What I wanted to see was if the messaging from Microsoft had changed since I wrote SharePoint 2013 Development–Microsoft has their Heads in the Clouds. It was very clear from the start that it had not – the developer sessions were all Apps and all Office 365. Aside from a brief comment here and there and one demo in one session, you wouldn’t have known that the Solutions model (farm and sandbox solutions) even existed. Also, all of the demos I saw were done on Office 365 and the presenters made claims and comments only applicable to Office 365 without qualifying that was the case. They seemed to assume that everyone had or will be moving to Office 365.


While the conference was going on I saw several Tweets and participated in or overheard conversations from attendees confused by what they had seen. Hopefully the following will help address some of the misconceptions and misunderstandings:


  • Farm and sandboxed solutions are still viable options in SharePoint 2013. Apps are an alternative to solutions, not their replacement.
  • Visual Studio 2012 has almost the exact same tooling for building solutions for SharePoint 2013 as Visual Studio 2010 did for SharePoint 2010.
  • You can still build and use web parts in SharePoint 2013. App parts are an alternative, not their replacement. 
  • Unless you only plan on building Apps for Office 365, you will need to install SharePoint on your development machine.
  • Apps cannot do everything farm solutions can do. While there have been significant extensions to CSOM and REST APIs, the Server Object Model is still more powerful and extensive.
  • Napa is a tool for learning and prototyping. It is not meant to be used to build production Apps.

I want to make it clear that I am not anti-App. I think the App model makes a lot of sense in several situations, I just don’t think it make sense in all situations.

SharePoint Dev Quick Tip–Finding the Internal Name of a Field

Note: For the purposes of this post I’m going to assume you know the difference between the display name and the internal name of a field and why you should use the internal name when referring to fields in code and queries.


There are several tools/tricks you can use to get the internal name of a field. In this quick tip I’ll show you two tools I like to use: Visual Studio and SharePoint Manager.


Let’s say we have a site named Demo that contains a list named Demo that contains a field named Application Type and that I want to get the internal name of this field. I can open Server Explorer in Visual Studio 2010, expand SharePoint Connections, expand the appropriate site collection (you’ll need to attach to it if there is no node), expand the Demo site, expand Lists and Libraries, expand Lists, expand Demo, expand Fields, and finally select Application Type. With this node selected I can look at the properties of the field in the Properties Window, one of these will be the internal name.


Capture2


Capture


Now, let’s say we want to get the internal name of the % Complete site column in the Demo site. The Server Explorer does not contain a node for site columns so we’ll use SharePoint Manager 2010 instead. SharePoint Manager is a free tool you can download from http://spm.codeplex.com/. Once you’ve downloaded the 2010 version and unzipped (there’s no install necessary), run the program as administrator. Just like we did in the Server Explorer, navigate down the tree view until you can select the node representing the % Complete field. The window on the right will show its properties, including the internal name.


Capture3

SharePoint 2013 Sandboxed Solutions Deprecated?

If sandboxed solutions could talk, I’m sure they would be uttering the famous Mark Twain line, “The reports of my death are greatly exaggerated”.


Twitter and other social media sites were a buzz early this week after the release of the SharePoint 2013 Preview. Amid the posts were some like these:


image


image


image


Needless to say there were many questions about what this meant. The issue was brought to the product team and they said that the text in some of the documentation did not clearly represent their position on sandboxed solutions. The documentation has since been changed to state: SharePoint sandboxed solutions are deprecated in SharePoint 2013 Preview in favor of developing apps for SharePoint. My interpretation of this is: we (Microsoft) feel that Apps can do what sandboxed solutions can do and we feel that the future of development on the SharePoint platform are Apps so we suggest you stop using sandboxed solutions.


So, are sandboxed solutions still supported in SharePoint 2013? Yes they are. What about the next version of SharePoint? Maybe, it depends on whether the App model is all it’s cracked up to be. It’s still too early to call.

SharePoint Dev Quick Tip – SharePoint 2013 Web Part Page

Took me a while to find how to create a Web Part Page in SharePoint 2013. You can create one using the New Document dropdown in the Site Pages library.


SP2013WebPartPage