wiliammbr's blog

Some thoughts on SharePoint and other random stuff

Month: March 2017

Complete Operations on Lists with CSOM

Sometimes we have to reach a SharePoint list through remote connections using C#. It can happen in a SharePoint App, a Console Application or maybe on an Azure Worker Role.

Below you can find some code snippets that will help you on integrating SharePoint lists with your application.

Basically, you will have to add the Microsoft.SharePoint.Client namespace.

using Microsoft.SharePoint.Client;
using SP = Microsoft.SharePoint.Client;

The required DLLs for programming these type of solution are:

Microsoft.SharePoint.Client.dll
Microsoft.SharePoint.Client.Runtime.dll

You can find them inside those folders:

SharePoint 2010: 14 Hive -> Folder: ISAPI

SharePoint 2013: 15 Hive -> Folder: ISAPI

Or just download it from MSDN, inside the SharePoint Server 2013 Client Components SDK!

After adding these references to our project, we can start coding.

Soon you will notice that everything depends on the ClientContext object, which manages the requests and the data that will be loaded.

In our examples we are going to use the variable siteUrl, that represents the URL for the Site Collection. The variable listTitle will also be used and it represents the Title of the list being used.

string siteUrl = "http://sitesharepoint";
string listTitle = "SharePointList";

So, let’s do some real stuff here:

Reading SharePoint lists:

Filtering SharePoint lists and selecting specific fields:

Creating list items:

 Updating list items:

 Deleting list items:

I believe these are the basics for consuming SharePoint lists. In the future I’m planning to show some complex examples, more focused on Office 365 and Azure integrations. Thanks for reading and I hope it can be useful to you

References:
MSDN

Study Guide for Exam 70-488 – Developing Microsoft SharePoint Server 2013 Core Solutions

Since last year, we received the announcement that some of the SharePoint 2013 certifications were being retired in September of last year. But after that, they extended the deadline to 2017. This new deadline can be explained due there is no new certifications focused on development for SharePoint 2016 have been released yet.

Exam on Microsoft’s website: https://www.microsoft.com/pt-br/learning/exam-70-488.aspx

Therefore, here is a set of links that you can use as a study guide to pass on that exam before it is retired.
This summary was once made by Martin Bodocky and kept on this blog post “70-488 – Developing Microsoft Sharepoint Server 2013 Core Solutions – Preparation links“. Unfortunatelly, it’s not online anymore, so I decided to provide this information once again at the same time that I must say: Bodocky made everything and helped me on passing this exam, back on 2014.

Continue reading

© 2017 wiliammbr's blog

Theme by Anders NorenUp ↑