On the 70-488 – SharePoint Core Solutions Exam

No brain-dumps or anything here; if you want the answers, go and study. However, it’s worth knowing about the structure of the exam.

Right, so this is one of the 4 exams you’ll need for the MCSD SharePoint Applications. We decided to fling me at this one without preparation – I’m a SharePoint developer, so shouldn’t I be good at this one without lots of learning?

Continue reading “On the 70-488 – SharePoint Core Solutions Exam”

On the 70-488 – SharePoint Core Solutions Exam

Observations on Office 365 – Part 2

Following on from customer related issues in Office 365, there are a number of technology issues that give me concern. I will caveat this that this is based on my last project, and by the time I write this the Office 365 SharePoint platform could have changed to address some of these problems.  Continue reading “Observations on Office 365 – Part 2”

Observations on Office 365 – Part 2

Observations on Office 365 – Part 1

We recently completed another Office 365 project, and I must confess, I’m still not sure about it. The project was reasonably successful – but there were a lot of tears shed, and we still have issues that are proving alarming difficult to deal with.

Broadly, I think, these issues can be broken down in to two categories – problems with the customer, and problems with the technology. Continue reading “Observations on Office 365 – Part 1”

Observations on Office 365 – Part 1

My Remote Event Receiver works in Debug, but not when published

Okay, I had exactly this issue – that my SharePoint App supporting my Remote Event Receivers would work when run under an F5 – debug deploy, but not when published properly. Annoyingly, I’ve found that I have to make a number of changes when moving between a ‘proper’ build, and an F5-deploy; I’ve mentioned those before, but they were turning off the AppUninstalling event, and replacing the ClientId in the app manifest with a *.

However, I’d checked these things, and my code still didn’t work. Continue reading “My Remote Event Receiver works in Debug, but not when published”

My Remote Event Receiver works in Debug, but not when published

Turn off the Minimum Download Strategy feature in CSOM

I have found that the Minimum Download Strategy can cause issues with some of the JavaScript/JQuery I used in some of my pages – particularly when using Display Templates. I’m not the only person to have problems with it, either. Well, here’s the CSOM to turn it off:

private static void RemoveMinimalDownload(ClientContext clientContext, Web web)
{
 Guid MDSfeature = new Guid("87294C72-F260-42f3-A41B-981A2FFCE37A");
 FeatureCollection features = web.Features;
 clientContext.Load(features);
 clientContext.ExecuteQuery();
 features.Remove(MDSfeature, true);
 clientContext.ExecuteQuery();
}
Turn off the Minimum Download Strategy feature in CSOM

Working with fields in CSOM

I’ve already detailed how to create a new Taxonomy Field in CSOM – here’s the more generic how to create a general field on a list.:

internal static void CreateFields(ClientContext clientContext, List targetList, string xmlDef)
{
 targetList.Fields.AddFieldAsXml(xmlDef, true, AddFieldOptions.AddFieldInternalNameHint);
 clientContext.ExecuteQuery();
}

And as a bonus, here’s how to set a field to be indexed in the client side object model:

internal static void SetIndex(ClientContext clientContext, List list, string fieldName)
{
	Field f = list.Fields.GetByInternalNameOrTitle(fieldName);
	clientContext.Load(f);
	clientContext.ExecuteQuery();
	f.Indexed = true;
	f.Update();
	list.Update();
	clientContext.ExecuteQuery();
}
Working with fields in CSOM

Upload a File with CSOM

This is an example of how to upload a file with the C# Client Side Object Model (CSOM):

internal static File UploadFile(ClientContext clientContext, Web web, string filePath, Folder folder, string fileName, string title)
{
 string target = folder.ServerRelativeUrl + "/" + fileName;
FileCreationInformation fci = new FileCreationInformation();
 fci.Overwrite = true;
 fci.Url = target;
 fci.Content = System.IO.File.ReadAllBytes(filePath);
File uploadedFile = folder.Files.Add(fci);
 uploadedFile.ListItemAllFields["Title"] = title;
 uploadedFile.ListItemAllFields.Update();
 clientContext.ExecuteQuery();
if (uploadedFile.CheckOutType != CheckOutType.None)
 {
 uploadedFile.CheckIn("Initial Upload", CheckinType.MajorCheckIn);
 }
 clientContext.Load(uploadedFile);
 clientContext.ExecuteQuery();
 return uploadedFile;
}

Note that this method also lets you set a title for the document, as well as the file name, and it checks the document in for you if required.

Upload a File with CSOM