Posts

Change the language settings on every mysite

Running a SharePoint Site with different languages? No problem! But making sure every user has the correct language settings? Maybe a problem. So why don't using Powershell? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 [Microsoft.SharePoint.SPSecurity] ::RunWithElevatedPrivileges({ # Enables SELECTED installed languages for each subsite in a site collection $webAppURL = "https://mysiteurl/" $webApp = Get-SPWebApplication $webAppURL foreach ( $spSite in $webApp .Sites){ $spWeb = $spSite .RootWeb $spWeb .IsMultilingual = $true $WebRegionSettings = New-Object Microsoft.SharePoint.SPRegionalSettings( $spWeb ); foreach ( $language in $WebRegionSettings .InstalledLanguages) { If ( $language .DisplayName -eq "English" -or $language .DisplayName -eq "German" ) { # Add the displayname of any langauge you have installed: -or $language.DisplayName -eq "Norwegian" -or $la...

SharePoint Framework Field Customizer project with multiple columns

Image
SharePoint Framework is growing fast and is doing well. With Field Customizer you can build an own rendering for columns in views like you used to build in CSR with JSLink. So there is an guide by Microsoft how to migrating your CSR applications into SPFx applications. It makes sense using this guide, because the Modern UI does not support CSR. The only struggle I had: Some CSR applications are rendering more than one column. So here is the topic of this post: How to build a SPFx Field Customizer Solution with multiple columns.

Changing the author field in SharePoint

An action nobody should do, but in some cases necessary: changing the author of an item. What do you need? a farm account PoweShell

First click in SharePoint List WebPart on wiki pages

Lets say you have a SharePoint wiki page with some content and you added a list WebPart underneath the text. You open the page and want to go into the list settings or add an item or do another operation you can do inside the ribbon. You will realize the ribbon is not there. First of all you need to click into the list to make the ribbon visible. There is a simple JavaScript solution.

Add the Blog template to an existing SharePoint Site

When you want a blog in SharePoint you typically create a Site Colletion or Subsite with the blog site template. In some cases you have created a team site, because of its features. But you want to use the blog features, too. So you need to activate the feature. To do so you need the the SharePoint Management Console - the UI does not allow you activating the feature.

Set SharePoint's PeoplePicker value with jQuery

PeoplePicker and default values - not so easy in SharePoint. So if you want a default value for a field you need to set it by your own, but how?

SharePoint's Choice Fields: how to arrange checkboxes or radiobutto in one row

Image
Of course there are multiple reasons to use checkboxes or radiobuttons - even in SharePoint. But the most common problem: if you have more than three choices your form is blowing up. The solution is to arrange them in a row. To do so we need to take a deeper look.

Canceled events in SharePoint calendar

Email-enabled calendars are great. Just add the calender into the recipients and your event appears in the SharePoint calendar. But what if you cancel the event? The event will be deleted in Outlook, but not in SharePoint..

Content Type Hub in SharePoint Online

Standards are good and sometimes you want some standards in SharePoint Online. A useful tool is the Content Type Hub. You should know it from SharePoint 2010 and 2013. Whenever you need it, you can create one, by activating the Site Collection Feature "Content Type Syndication Hub". This feature allows you to publish your Site Columns and Site Content Types to every other site Collection. So you might thing you can build your hub in SharePoint Online by activating the feature on a new Site Collection. If you do so you will get an error. It tells your proxy is not working correctly, but this is not true. In fact there is already an hub and you cannot build a second one. The hub is hidden so you cannot see it in the Site Collection Overview in your admin center. You need to know the URL: https://yourprefix.sharepoint.com /sites/contenttypehub  

Restart the SharePoint OWSTIMER

There are a lot reasons to restart the Timer Job in SharePoint. You can do it by going to Services and stop the owstimer service. Is this the only way? Are there more even better ways? Well, there are some other ways, but there is no best practice. 

SharePoint REST - get more than 100 list items

Since SharePoint 2013 you can use REST calls to get or set data. But if you firing a call against a list with 101 items you will get only 100. The cause is based at the REST interface. To reduce server overload the result is limited - it is called server paging. That is pretty smart, but what if you need all results? There are two ways of solving this problem. The first and easy one is to set the $top flag. So you add ?$top=101 to your REST call and you will get all 101 items. This works fine until you have 102 items.

Website with animation with CSS only

In some cases it is needed to start animations on a website. If you are looking for some code you will find a lot of JavaScript solutions, but in my mind this is not the right way. JavaScript should be there for the logic, getting data and working with it and not for UI stuff. So there needs to be a solution without JavaScript. In this case: a div with background-color.. the color should change, after it is displayed. 1 2 3 4 <div class= "container1" > <div class= "container2" > </div> </div>

SharePoint 2010 "Navigate Up" points to the wrong URL

Image
Today I had a problem with the "Navigate Up" button in SharePoint 2010. The server moved once to a new URL, but the navigation was still pointing to the old one. The internet told me to change the masterpage.

How to embed an image into your WPF application

If you are building an WPF application you could need images as background or as buttons or whatever. With your  first build or debug you will see the images will be stored in a folder that should not change. If you change it the application cannot find its images and crashes. So if your installing this application you will need to make sure the pictures are in the exact place. There are possibilities to make the path of the path dynamic, but even that is not the best solution.  So how to make sure your files will be where your application will be.  The solution is to embed the images, but how..? Of course there are some hacks you need to know. First of all you need to right click on your project in Visual Studio. Go to "Properties" and then "Resources". Add a resource and choose existing file. Choose your image.

Refresh the User Information List in SharePoint

If you are going into the User Information List, you will sometimes see it is not up to date. There are two jobs (User Profile to SharePoint Quick Sync and User Profile to SharePoint Full Sync). The quick sync will only add new member into your list and somehow it does not work sometimes. So you need to trigger the full sync. The question is how.. there is no point in the UI to do so and not even PowerShell is able to start it. The good old stsadm will rescue us. There are two commands you need to execute in your SharePoint Managing Shell (as administrator).

SharePoint get field by GUID with PowerShell

Once I was looking for a problem in SharePoint, I've spent some time digging the ULS Logs. There was an error with the message " Failed caching field with id '{GUID}' ". The first problem I had was the question: which field? So I decided to build a script that returns the name of the field. After I knew the name, I wanted to know where the field is used, so I extended the script. Now it returns the Lists and Content Types where the field is in use.

How to make sure only one instance is running

Some application cannot be run in multiple instance for several reasons. So you need to avoid a second instance will run, but how? You cannot directly block the execution of your application, so you need to take care of the problem in your code.

Excel column letters into number

Sometimes you need to loop cells in Excel. In fact it is looping rows and columns, because cells have two dimensions. The rows are counted up, but the columns are named alphabetic. Looping them is not that easy and gets harder until you hit the Z , because the next 'letter' would be AA . So a number would be more easy.

Redirect in SharePoint provider hosted Add Ins

If you are using an asp:hyperlink to another page in your provider hosted app you will see the SharePointContextProvider will not be able to handle the redirect. To fix the problem you need to add a click event and call a redirect in your code behind.

register and debug provider hosted SharePoint Online Add Ins with tenant full controll

It is a while since Microsoft launched the Add In (or App) architecture for SharePoint, but there are still things they change or we are not familiar with. In August 2016 there was a change in giving tenant permissions to provider hosted Add Ins using app-only mode and Azure Access Control Service (ACS).