OData BCS Code Sample from TechEd 2014

Full Session Recording

Last Wednesday, I presented a session on SharePoint’s Business Connectivity Services at Microsoft’s TechEd 2014 North America. It’s mostly demo and the recording is available on Channel 9.

OFC-B311

To start, I show connecting to a SQL Database from SharePoint Designer, creating an external list, modifying it’s views, adding an external business Data Column to a Document Library and surfacing the External Data in a Word Document.

Development Example Part of Demo

When @jthake told me my session was in the developer track on Monday, I decided to add some Visual Studio 2013 to my demo. For the Microsoft Virtual Academy Advanced SharePoint Solutions Jumpstart, I had created a demo of connecting to and OData web service from Visual Studio with Office 365 SharePoint Online. It was so easy, I decided I could fit in a similar demo to this TechEd Session. In the recording above, the App Model demo starts around minute 38, if you want to skip the traditional examples before it.

Products

Source Code on github.com/OfficeDev

I’ve published the source code for my demo to GitHub under the OfficeDev account. Clone it, run it, fork it, extend it!

Microsoft is embracing git as an method of code collaboration lately. The Office Dev team has recently taken to publishing code on github.com. If you’re new to GitHub, I recommend downloading GitHub Windows. The client will allow you to easily “clone” the code to your local hard drive where you can then open into Visual Studio.

Note: the first thing you’ll want to do is change the url for the project from tomresing.sharepoint.com/sites/dev to your SharePoint 2013 Development Site Collection.

OfficeDevGitHubBCS

Added app.js code

If you attended the session or watched the video and then download the code, you’ll notice one difference. Live, I didn’t write code to dynamically create a link to the new external list. For the sample, I didn’t want to leave you without a way to browse to the list. So, I added some Client Side Object Model code to iterate through each of the lists in the App Web, find their hyperlink and add them to the page so you can get to “Products.”

ListOfLists

Here’s the code, in case you’re interested:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.