wiliammbr's blog

Some thoughts on SharePoint and other random stuff

Tag: SharePoint (page 1 of 2)

SPFx apps not showing in SharePoint 2016 apps

In September 2017, Microsoft announced support to the SharePoint Framework in the (not so new) SharePoint 2016.  It is a great feature that will let developers explore the new framework in the cloud and on premises, allowing them to embrace the new modern era of SharePoint with SPFx apps.

But first, if you don’t know anything about the SharePoint Framework, please read this guidance to get in touch with the new trends for SharePoint Development.

The step-by-step to explore this development is pretty straightforward. Just do as the Microsoft tutorial suggests to build a web part and have an environment prepared for apps in your SharePoint 2016 farm.

Some important notes are:

  • The SharePoint Framework version must be 1.1.0;
  • SPFx extensions are in preview for this version;
  • The SharePoint Web Parts will be presented as normal Web Parts in the Ribbon;
  • There is no modern experience available yet;
  • You must use a CDN or even the Style Library to store the published files;

If everything is fine, you can just upload your App Package to your App Catalog and it will work.

But that wasn’t my case…

Continue reading

Debug specific W3WP in SharePoint

Sometimes we need to debug Visual Web Parts and Event Receivers deployed as Farm Solutions. To accomplish that is simple, just open your Visual Studio, attach to the W3WP processes and refresh your page.

Well, it’s pretty common in our daily life tasks (not so much since we all should move to the Client-side of the force) to have more than one W3WP available to attach. Usually we have one for your site, other for SharePoint Web Services, another for the SharePoint Central Admin and even more for any other Application Pool Process being used in your Server.

But if you want to attach to just one process and make Visual Studio more performatic and responsive, how can you do that?

Just follow the steps in this post!
Continue reading

Study Guide for Exam 70-489 – Developing Microsoft SharePoint Server 2013 Advanced Solutions

Finally I could publish the Study Guide for Exam 70-489 – Developing Microsoft SharePoint Server 2013 Advanced Solution. It’s also based on Martin Bodocky’s preparation links with some additions, like the previous post for Study Guide for Exam 70-488 – Developing Microsoft SharePoint Server 2013 Core Solutions.

Exam on Microsoft’s website: https://www.microsoft.com/en-us/learning/exam-70-489.aspx

Actually I’ve decided to publish this one because the high number of page views for the last one. At the same time Microsoft launches SharePoint 2016 and keeps improving SharePoint Online, people still are looking for the SharePoint 2013 exams.

Continue reading

Sync SharePoint files with Visual Studio Code

The last three months I’ve been working less with SharePoint and more with Angular 4/Node JS projects. This change forced me to use less Visual Studio and dive deep into Visual Studio Code in almost every task.

While working with VSCode, I’ve been testing some Gulp tasks like SPSave and SPSync for automatizing file changes to SharePoint, just for fun. Because I just can’t accept SharePoint Designer anymore, my patience with it ran out.
Also the Windows feature to map a network drive to a SharePoint library isn’t good too, at least for me.
So basically the gulp tasks did the trick, but they aren’t that easy to be understood for some more “traditional” programmers in my company, which would end with few adopters here.

So while searching for SharePoint extensions just for curiosity, I found the SPGO Extension and it really impressed me!

Basically it’s an extension that with some basic setup you can start syncing files from your computer with SharePoint libraries.

SPGo Extension

SPGo Extension

Continue reading

Recover corrupt Lookup Field

Sometimes we need to transfer a list from a Production environment to a Development environment, just to reproduce some bug or situation with real data. It can achieve by the Save as Template feature, exporting it from an environment to another and then recreating the list.

But, if you have Lookup fields it can give you some headaches. As soon as the list is restored in the other environment, the Internal Guids are changed an any connection to the source list of the lookup column will be lost:

The option Get information from will be empty and the column name will be a span, not a a dropdown. where you could select which field should be presented:

Continue reading

SPQuery – Build better queries

So many times I’ve seen my clients complaining about the performance of their Sharepoint sites. That of course collaborated to create a bad impression of the product. “The page takes too long to load” or “Web Parts with pagination are terrible” were some of their protests.

After the first contact with them, I usually asked for the source code to find out what was happening. It didn’t take too much to find out that almost every case there were happening due queries being made with SPList.Items property and followed by some LINQ query to filter the data.

Continue reading

Paste images to SharePoint pages

One thing that I had to face and discuss at least once a month among Clients requests was: an easy way to paste images into SharePoint pages. Although my automatic answer was always “Just upload it through the ribbon, so you can tag and ensure the content quality”, I have to admit this way isn’t THAT user-friendly.

That’s why I decided to develop some JavaScript code to add this functionality to my Web Pages, so the users could be able to add their images faster. Basically, I’ve created a GitHub repository to keep the code, so maybe someone can help me on refactoring it or adding support for others browsers.

https://github.com/wiliammbr/sp-copypasteimages

The project is a SharePoint provider-hosted app that publishes some JavaScript files to your Site Assets library. It was based on some SharePoint projects in the PnP – Patterns and Practices, hosted by Microsoft. Also, it will add ScriptLinks to insert those script files into your pages. In my example, the app was hosted in an Azure Cloud Service.

Continue reading

“You are not allowed to respond again to this survey” message on SharePoint

One of my favorite list templates in SharePoint is the Survey template. It’s a fun and useful feature that helps you on achieving a good survey-like form with charts and insights. You can make them anonymous, do some customizations and add Branching Logic, which means conditional questions depending on what the user answers.

Form example

Survey overview

But it has one main behaviour that I just don’t like, that is the message when you try to answer the survey again. Below you can check the message with Custom Errors disabled.

Message: You are not allowed to respond again to this survey

 

Theorically, the user has the required permission to edit its answers. But unfortunatelly once I try to answer again, SharePoint shows me that message as an error. This is a huge problem for users that don’t understand this message and it can be negative to the system.

Continue reading

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

Older posts

© 2018 wiliammbr's blog

Theme by Anders NorenUp ↑