Geeks With Blogs
Thorvald Bøe sharepoint
Create a multi line rich text field in a SharePoint list using REST
I recently needed to create a rich text field in a SharePoint list programatically. Since I am using REST all over the place, it would be practical to continue that now as well.I was able to find out how to create a new field. It is done by posting to this url: reqUrl = appweburl + "/_api/SP.AppContextSite(@t... + listName + "')/fields?@target='" + hostweburl + "'";For example like this:$.ajax({ url: reqUrl, type: "POST", data: "{ '__metadata': { 'type': 'SP.Field' }, 'Title': ......

Posted On Thursday, January 14, 2016 12:32 PM

Finding the maximum number of sub sites in SharePoint Online
When dealing with SharePoint Online, there are some limitations to consider.The most famous one is the list view threshold of 5000 elements in a list view. But there are also others. In my company, we have implemented a project workspace solution for managing projects. In essence, we create a subsite for every project in a project list. This has lead us to another potential limitation: The number of subsites per site collection.When googling the limitations of SharePoint Online, I find a page saying ......

Posted On Friday, December 18, 2015 1:14 PM

Creating a SharePoint list item from an app/add-in part - fun with form digest
Ok, I will try not to make this a rant, but after knocking my head against the proverbial wall for several hours, that is going to be a tough one, LOL.The problem was seemingly trivial: Create a SharePoint hosted add-in part with a button that creates an item in a list in the host web.After all, I have been working with list items quite a bit from the SP hosted add-in, so doing it from an add-in part should not be so difficult, right? Wrong!As you might know, when modifying a sharepoint list (e.g. ......

Posted On Tuesday, October 6, 2015 8:48 PM

Add default values for date fields in list edit forms using moment.js
I love the SharePoint lists, they are so easy to set up and customize. I use it all the time.Still, there is room for improvement. The display/new/edit forms for example, are not very customizable OOTB. However, by making some very simple tweaks, you can make great improvements. This time I had a form displaying a couple of date fields, where it was desired to display default values based on some simple logic.The basic problems here are:1.SharePoint has very limited functionality for default values ......

Posted On Friday, March 6, 2015 9:51 AM

SharePoint architecture in an enterprise scenario
I want a discussion on SharePoint architecture in an enterprise scenario. What is the way to go? SharePoint 2016 has been announced as the last version for OnPrem, and even if OnPrem is far from dead, SharePoint Online seems to be the investment focus for MS, so let's focus on this. SharePoint Online is a great product, but it has its limitations. Farm solutions are not allowed, and while coded sandboxed solutions still work, they are classified as deprecated and might not be supported any time soon. ......

Posted On Monday, February 16, 2015 12:14 PM

Build a simple auto increment feature in SharePoint 2013 list
Every now and then I stumble across this requirement. And every time I seem to have forgotten how to do it, and try various approaches like using a calculated field based on Id, or using a workflow based on the Id.Bottom line is, at the time of creation, the item Id is not yet set, so you cannot use it, neither from a calculated field nor from a workflow. But with a small workaround, it is possible to make it work in an easy and robust way. After writing this post, I hope I will remember the next ......

Posted On Wednesday, January 14, 2015 3:37 PM

Problems starting the user profile synchronization service
This seems to be a quite common problem. This is what I tried:1.Central Admin - Services on server: Tried to start the user profile sync service (the user profile service was running). Result: Status changed to "Starting" for a few seconds, then back to stopped. I found no trace of errors in ULS or event log2.I cleared the configuration cache (link) - Still unable to start the service3.Added the user running the service (in my case the sp_farm user) to local administrators.Note: This sounds like ......

Posted On Tuesday, October 14, 2014 9:54 AM

Setting up the app catalog on SharePoint 2013
I just finished setting up an app catalog for a client on SharePoint 2013 on premise. It was a daunting task, and turned out to be much more difficult than when I tried in my own development environment in Azure. I will share some of my experiences so that you might escape some of the hurdles.First of all, if this is your first time setting up app support, prepare well! It doesn't have to be too difficult, but it involves a few steps, and there are plenty of places to go wrong, which would lead to ......

Posted On Friday, August 22, 2014 9:09 AM

Where is my services list?
Recently, I have been doing some work on setting up an app catalog on a SharePoint server. As with many other SharePoint related tasks, it seemed quite complicated at first, but quite easy once it was done and working. The whole process could be material for another blog post, but I wanted to write this blog post about one particular problem that I have ran across at several occasions, among others when I was going to set up the subscription service that was required for the app catalog.As I am a ......

Posted On Thursday, August 21, 2014 3:56 PM

Sending email with SharePoint and jQuery
Want to send email from SharePoint using jQuery? No problem!No need to create workflows or set up SMTP servers, just use this simple function:function sendEmail(from, to, body, subject) { var siteurl = _spPageContextInfo.webServe... var urlTemplate = siteurl + "/_api/SP.Utilities.Utility... $.ajax({ contentType: 'application/json', url: urlTemplate, type: "POST", data: JSON.stringify({ 'properties': { '__metadata': { 'type': 'SP.Utilities.EmailProperties' }, 'From': from, 'To': ......

Posted On Thursday, July 3, 2014 3:58 PM

Setting up user profile service in SharePoint 2013
Setting up active directory integration in SharePoint 2013 can be extremely simple. If you only need to import users, and not write back changes to AD, the User Profile (UP) service is a good alternative to the User Profile Synchronization (UPS) service.I stole these steps from this article: http://www.harbar.net/archi... short version if you know where to go:1.Check that the UP service is running, and if necessary, create a UPA (User service profile application)2.CA\Manage ......

Posted On Monday, June 30, 2014 3:33 PM

Solving the problem of large SharePoint database log files
I came across a problem of some SharePoint databases whose transaction logs had grown extensively during a test period with lots of data import etc. causing a lot of transactions. The fix was quite simple, as described in this article:http://microtechpoi... the recipe:1.Locate the database log files in the file system, and select your targets based on size2.Locate the respective database in Management Studio3.Right-click the database and select ......

Posted On Tuesday, June 10, 2014 1:14 PM

How to upload files to a SharePoint 2013 document library using jQuery
I found a great code sample on how to upload files to a SP 2013 library using javascript/REST.The code worked like charm with almost no modifications - just had to change the input control name and the document library name and type. Thanks to Rob Windsor for providing the sample!Note: Requires html5 support, will not run in older browsers.The original article is here: http://sharepoint.stackexch... is the sample code:function ......

Posted On Friday, June 6, 2014 11:57 AM

This view cannot be displayed because the number of lookup and workflow status columns it contains exceeds the threshold (8) enforced by the administrator.
This error might occur on SharePoint 2013 if you have a list with many lookup columns. The general recommendations are:1.Do not mess with the resource throttle settings - it may have serious impact on performance2.Rather create views that limit the number of lookup or workflow columns in a single viewBUT, if you really need to increase the limit anyway, e.g. because you are running a development server and need to access the default view of a large list, I will show you how to do it:1.Go to central ......

Posted On Wednesday, March 26, 2014 12:52 PM

SharePoint REST - adding list items with lookup columns
When working with SharePoint and REST, you will sometimes need to update list items that contains lookup columns.This is quite straightforward as long as you know how the lookup value is represented in the json string. However, the problem occured because I had worked with lookup columns just many enough times to not give much thought to the process of creating them, and just too few times to have experienced this situation before.The thing is that when retrieving list items with lookup values in ......

Posted On Tuesday, March 11, 2014 4:12 PM

How to add a new url to a SharePoint web site
The topic of Alternate Access Mappings in SharePoint can be quite confusing, at least it was (and still is..) to me. I don't claim to fully understand it, nor will I try to explain it. But if you want a simple, no-bullshit recipe on how to add a new URL to SharePoint 2013, you have come to the right place.The scenarioLet's say your company is already running the intranet on a SharePoint 2013 server, with base address http://intranett. You are working on another web site, e.g a hseq app, and you want ......

Posted On Tuesday, May 27, 2014 10:03 AM

SharePoint and jQuery loading nightmares
SharePoint is great. jQuery is great. Together, they are brilliant! At least that is how it is supposed to be, but unfortunately there are a few caveats here that can lead to some nightmareish random async error situations.I spent quite a few hours debugging exactly such a situation in a recent project. Maybe these experiences will help someone in a similar situation.The task:Create two web parts, let's call them the project web part and the quote web part. They will be built using jQuery and display ......

Posted On Tuesday, May 13, 2014 2:36 PM

Solving cross domain issues
I had the following scenario:1 SharePoint onPremise site installed on IIS port 801 Dynamics NAV site with some web services to be utilized on the SharePoint siteMy task was to create some web parts to display project information coming through the NAV web services. As I have used the content editor web part with jQuery pattern very successfully in the past, I saw no reasons why it shouldnt work this time. It did, but I ran into a few hickups.First, I needed to consume the web services from jQuery. ......

Posted On Tuesday, February 18, 2014 12:57 PM

Stop contributors from editing pages in SharePoint 2013
An interesting thing about default settings in SharePoint 2013 (and maybe previous versons as well) is the way that default permissions are set up. Consider this scenario:-You want to divide your users in two groups, administrators and contributors, where admins have full access and contributors can only view and edit list and document library contentsYou check out the default security groups, and it turns out there are two groups that covers exactly what you want. So you just assign admins to the ......

Posted On Sunday, February 2, 2014 9:37 AM

Disable a people picker field in SharePoint 2013 with jQuery
jQuery is a nice tool when working with SharePoint, because it lets you create behaviour that is not available using standard configuration and improve usability and business value of your solution.Still, it is not always trivial to perform seemingly trivial tasks with jQuery and SharePoint, because you are so much closer to the metal and the inherent complexity of SharePoint gets in the way of simple tasks.I think for the future, Microsoft would gain from providing a client side library for manipulating ......

Posted On Sunday, February 2, 2014 2:37 PM

Display in image from a picture library in SharePoint 2013 using Javascript and REST
Having jumped on the SharePoint bandwagon not too long ago, means that sometimes you end up in a situation where you are "just going to do a simple thing" and it turns out that:a) It is not so simple, andb) Finding information is even less simpleI often find myself in this situation, and since I don't have a decade of SharePoint experience to fall back on, I will have to rely on my old friend Google. Fortunately we have a long and understanding relationship, and even though this time it was harder ......

Posted On Tuesday, January 28, 2014 10:03 AM

Javascript and SharePoint rich text fields
When programming against SharePoint using Javascript and REST, there is a little gotcha when using the "multiple lines of text" type in a list. When retrieving a value for this type of field, the result is by encoded to support rich text, like this:If you want to simply retrieve and use the text value, you've got a problem. My first thought was to decode the string using some kind of jquery method. This is not so simple as it seems, and while there are ways to get it done, you will still be in trouble ......

Posted On Thursday, January 9, 2014 3:57 PM

Nested promises...
The title of my first blog post could possibly have been taken from a poorly written love song, but it's not. Instead it is from some (hopefully not so poorly written) javascript code.Ok, so this javascript world is kind of new to me. Not that I haven't used javascript for the last 13 years or so, it's more that my acceptance of javascript as a full fledged development tool is kind of new to me. With javascript libraries popping up all over and it being promoted as a knight in shiny armour to recue ......

Posted On Wednesday, November 20, 2013 4:11 PM

Copyright © Thorvald Bøe | Powered by: GeeksWithBlogs.net