Étiquette : sharepoint

Add a SharePointWebControls into a HTML version of a MasterPage [Sharepoint 2013]

In Sharepoint 2013 it’s now possible to create the MasterPage based on an HTML file. Here is the snippet you need to add into your HTML page to get a SharePointWebControls: <!–SPM<%@ Register Tagprefix= »SharePointWebControls » Namespace= »Microsoft.SharePoint.WebControls » Assembly= »Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c » %>–> <!–CS: Start Create Snippets From Custom ASP.NET Markup Snippet–> <!–SPM:<SharePointWebControls:TextField runat= »server » FieldName= »Title » />–> <!–CE: End […]

Play with ribbon on Sharepoint

In Sharepoint 2010 and 2013, there are some existing functions to deal with the ribbon. Below an example of what we can do: // we need the file « sp.ribbon.js » SP.SOD.executeOrDelayUntilScriptLoaded(function () { // use PageManager var pm = SP.Ribbon.PageManager.get_instance(); // define a function to call when the ribbon is loaded var DoSomethingWithRibbon=function(ribbon) { // For […]

How to expand Sharepoint 2013 calendar by default [JavaScript]

This code has been tested for Sharepoint 2013 only. It permits to expand by default (so as soon as the page is loaded) the events in the Month calendar view. See here a solution for Sharepoint 2010. Tested with IE8 and Firefox 41. You’ll have to add the below JavaScript code into your calendar page: […]

Sharepoint Workflow: Check if a field is empty [Sharepoint 2010]

The Sharepoint workflows are powerful but sometimes stupid… If you want to: Check if a Date Field is empty, then you can use a String Workflow Variable that contains your Date Field as a Short Date (SP2013) (or a String for SP2010), and then compare it to « 1/1/0001 » (or « 1/1/0001 12:00:00 AM » for SP2010) Check […]

How to expand Sharepoint 2010 calendar by default [JavaScript]

This code has been tested for Sharepoint 2010 only. It permits to expand by default (so as soon as the page is loaded) the events in the Month calendar view. See here a solution for Sharepoint 2013. Tested with IE8 and Firefox 34. You’ll have to add the below JavaScript code into your calendar page: […]

Problem with the People Picker of Sharepoint

For one of my list I’ve had a very weird issue: one people picker didn’t work properly. If I entered a name and clicked to check it, then it didn’t work. If I saved it and then got back to the form, the value didn’t appear. This strange behavior is due to a missing SPAN […]

Use hash word in the Sharepoint navigation

Let’s say you have the url http://my.site.com/myfolder/mypage.aspx#hash and you want to use it as a link into your left navigation bar in Sharepoint…. If you try putting that name, Sharepoint will not keep your link. The trick here is to add a questionmark juste before the #. The URL to use will be http://my.site.com/myfolder/mypage.aspx?#hash and […]

How to edit the default action for an icon in a Sharepoint Ribbon

I wanted to change the behavior of the « Edit Item » button from the Sharepoint 2010 ribbon of the Display Form (DispForm.aspx). It wasn’t really easy, so I finally found a solution that I’m going to share here. You’ll need to use JavaScript for that. In the below example, the click on the « Edit Item » will […]

Show/Hide a Sharepoint fields in the NewForm, EditForm and DispForm

With the Sharepoint WebServices it’s possible to hide a field into the NewForm, the Editform and/or the DispForm. You’ll need to use JavaScript with jQuery and SPServices. It’s the UpdateList service that will do the trick. Once you have loaded the both librairies you can use the below code: var fieldsToUpdate = ‘<Fields>’; fieldsToUpdate += […]

Delete a User Custom Action from Sharepoint [JavaScript]

The MSDN documentation is a nightmare…. For example Microsoft provides an example to create a User Custom Action for Sharepoint, however there is no code about how to delete it. So here is the code to use to delete the usercustomaction just created with the above example: var siteUrl = ‘/site collection/site/’; function deleteUserCustomAction() { […]