howto : Modify the Edit Form of a SharePoint 2013 list with CSR (JSlink)

This step by step guide will show you how the provide a slider control for a number field in a SharePoint list:

  1. Download the following code and upload the file in your Style Library or Site Assets Library.
  2. Open the list where you want to modify the edit form and click on edit item.
    editform1
  3. Click on the gear icon in the upper right corner and click on edit page.

  4. Hover over the right corner of the web part and click on Edit Web Part
    editform3
  5. Set the path to your javascript file in the JSLink property
    editform4
  6. Click OK
    editform5

Hope it helps!

If you want more information, please review the following http://code.msdn.microsoft.com examples.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: -1 (from 1 vote)

New O365 roadmap windows 8 app

The Office 365 for business roadmap lists updates that are currently planned for applicable subscribers. Updates are at various stages from being in development to rolling-out to customers to being generally available for applicable customers world-wide. Expand an update to learn more about it and click the learn more link to read more details.

Learn more about Office 365 for business service updates here.

Please install the Offfice 365 for business service updates app from http://apps.microsoft.com/windows/nl-be/app/o365-roadmap/f6e425c8-cb5b-4434-81fa-7358af955852

home launchedinprogress rollingoutdetails

Hope it helps!

Stay tuned :)

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Working with SharePoint Online & PowerShell

Scenario:

  1. Connect to SharePoint Online via PowerShell running on my local computer
  2. Authenticate myself
  3. Open the context of a specific SharePoint Site
  4. Retrieve a specific library
  5. Find a specific folder in this library
  6. Delete/recycle the items in this folder

Result:

# replace these details (also consider using Get-Credential to enter password securely as script runs).. 
$username = "YOURUSERNAME" 
$password = "YOURPASS" 
$url = "https://YOURTENANT.sharepoint.com"

$folderName = "somefolder"
$libraryName = "Documents"

$securePassword = ConvertTo-SecureString $password -AsPlainText -Force 

# the path here may need to change if you used e.g. C:\Lib.. 
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" 
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" 

# connect/authenticate to SharePoint Online and get ClientContext object.. 
$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($url) 
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePassword) 
$clientContext.Credentials = $credentials 
if (!$clientContext.ServerObjectIsNull.Value) 
{ 
	$checkUrl = $clientContext.Url
    Write-Host "Connected to SharePoint Online site: '$checkUrl'" -ForegroundColor Green 
} 

# check if library exists
$web = $clientContext.Web
$list = $clientContext.Web.Lists.GetByTitle($libraryName); 
$query = New-Object Microsoft.SharePoint.Client.CamlQuery
$query.ViewXml = '1'+$folderName+'';  
$collListItem = $list.GetItems($query)
$clientContext.Load($collListItem)
$clientContext.ExecuteQuery()

if($collListItem.Count -eq 1){
    Write-Host "Folder exists: '$folderName'" -ForegroundColor Green 
}else{
    Write-Host "Folder '$folderName' does not exist" -ForegroundColor Red
	Exit
}

# check if library exists
$web = $clientContext.Web
$list = $clientContext.Web.Lists.GetByTitle($libraryName); 
$query = New-Object Microsoft.SharePoint.Client.CamlQuery
$query.ViewXml = ''; 
$query.FolderServerRelativeUrl = "/documents/somefolder"
$collListItem = $list.GetItems($query)
$clientContext.Load($collListItem)
$clientContext.ExecuteQuery()

$itemsToDelete = @();

if($collListItem.Count -eq 0){
	Write-Host "No files found in this folder" -ForegroundColor Red
	Exit
}

Write-Host
Write-Host "I'm deleting the files now..." -ForegroundColor Green
Write-Host

#recycle items via id
foreach ($id in $itemsToDelete){
 	$itemToDelete = $list.getItemById($id);
    $recycled = $itemToDelete.deleteObject(); #Recycle()
	$clientContext.Load($collListItem)
	$clientContext.ExecuteQuery()
	Write-Host "	$itemToDelete['FileLeafRef'] is deleted" -ForegroundColor Yellow
}
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Ultimate diagnostic JSLink script

My friend Elio Struyf launched the Ultimate diagnostic display template on the last SharePoint Saturday, so why not follow his example for the new awesome JSLink feature added in SharePoint 2013.

You can modify the UI of SharePoint 2013 lists by only using JavaScript, but what if you do not know the correct internal names?The following script can be used to render the properties and the values of the current item.

Based on this information, you can optimize your jslink script to render the data in the format you want.

Hope it helps!

function ShowAllProperties(ctx) {
    var url = ctx.CurrentItem;
    var html = "<table>";
    for (att in url) {
            html += "<tr>"
            html += "<td>"+att+"</td><td>" + url[att]+"</td>";
            html += "</tr>"
        }
    html+="</table>"
    return html;
}

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

VIDEO : What are apps for SharePoint?

Apps are small, easy-to-use, stand-alone applications that solve a need for your users or business.

Site owners can install, upgrade, and uninstall them on their SharePoint sites without farm or site collection admins.

from http://msdn.microsoft.com/en-US/office/dn448478

VN:F [1.9.22_1171]
Rating: 10.0/10 (2 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

How to create charts from SharePoint 2013 lists via SharePoint Apps

A colleague (Koen Zomers) pointed me towards a very interesting Javascript library called jchartfx to render client side charts.

The following SharePoint Hosted App allows you to add an App Part on any page and use another list within the same web to display the data in a graph.jchart_overview

jchart_properties

By simply changing the Chart Type in the App Part Properties you can change the rendering of the Graph.

jchart_overview.lines

Step 1: Create SharePoint Hosted App

I would strongly recommend following this excellent article on MSDN.

Step 2: Use the cross domain library to retrieve information from the host Web

In order to retrieve information from the host web we need to set the appmanifest permissions so that our app is allowed to read list items from the SharePoint web where we install our app.

Step 3: Provision the required jChartFX libraries

Koen pointed me to the Getting Started section of the JChartFX site and I used this demo to get started.

Step 4: Create App Part

Code examples

Hope it helps!

VN:F [1.9.22_1171]
Rating: 8.7/10 (7 votes cast)
VN:F [1.9.22_1171]
Rating: +4 (from 4 votes)

Using JSLink property of the XsltListViewWebPart to control the rendering of a list, listitem & field

Creating the UI of a SharePoint list has been a challenge in the past. We needed SharePoint Designer, XSLT or custom webparts in order to take control of the presentation of our data in SharePoint lists

In SharePoint 2013 you are in control with no impact on the infrastructure of the farm.

The following steps make it very easy for you to control the UI:

  1. Create a new custom list
  2. Add a new column called “Score”newfield
  3. Add multiple items with different scores (These values are only for demonstration purposes)defaultview
  4. Navigate to the gear icon in the upper right corner and press edit page
  5. Edit the web part properties and locate the propertie JSLink at the bottom
  6. provide the following link: ~site/siteassets/jslink.jsjslink
  7. Press OK
  8. Upload the attached jslink.js file to the site assets library
  9. Open the custom list you created and notice the KPI’s.kpi

What if you do not want to take control over a field, but you really want to change the presentation of the entire item?

By modifying the jslink.js, it is possible to provide a render method that will take control over the UI of the item. The following screenshot show you the result when you loop over the attributes of the ctx.CurrentItem object.
Check out the LoopOverAllVars script to see the source.allvars

In our scenario it would be possible to create another view called executive summary and visualize the data like thisitemcontrol

It depends on the customer’s requirements how the information need to be displayed, but I think this technique is very efficient!

Hope it helps!

VN:F [1.9.22_1171]
Rating: 9.7/10 (3 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

Introducing: The SharePoint and VBA Code Analyzer

Learn about a tool that analyzes your SharePoint full-trust code solutions and Office add-ins and macros to help you redesign them for the app model. Security is important to us—your code remains private while using the tool.

screen

http://blogs.msdn.com/b/officeapps/archive/2014/03/04/introducing-the-sharepoint-and-vba-code-analyzer.aspx

Hope it helps!

VN:F [1.9.22_1171]
Rating: 9.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Overview of the issues that are fixed in SharePoint 2013 SP1

This information is a crosspost from:

Overview:

SharePoint 2817429​ Metadata is lost when documents   that use a custom content type with a “Description” field are   opened for editing.
SharePoint 2817429​ When an item is deleted,   restored from recycle bin, and then deleted again, there is a primary key   constraint error.
SharePoint 2817429​ An error occurs when files are   moved between document libraries and the web time zone is behind that of the   server.
SharePoint 2817429​ Metadata filtering at list level   always lists all metadata terms.
SharePoint 2817429​ The hyperlink popup window drops   the selected word to be linked when there is a delay of more than one second   in opening the window.
SharePoint 2817429​ Multiple-column,   SummaryLinkWebParts with a group heading style of “Separator” are   rendered incorrectly.
SharePoint 2817429​ A hash tag that contains a full   width space does not get created successfully.
SharePoint 2817429​ Search schema compression is now   enabled by default to allow larger search schemas.
SharePoint 2817429​ Highlighting for FQL queries is   now enabled for FQL as well as KQL.
SharePoint 2817429​ Opening a custom SharePoint list   in datasheet view and applying multiple custom filters, where each filter has   more than one condition, can result in an incomplete set of list items.
SharePoint 2817429​ When the “Export to   Excel” button is clicked in a SharePoint document library that has the   Content Type field displayed, the Content Type field does not appear in the   Excel workbook.
SharePoint 2817429​ An error occurs after changing   the “Manager” property in EditProfile.aspx page when the My Sites   WebApp is not in the same farm as the UPA.
SharePoint 2817429​ SharePoint REST API does not   return a well-defined error response for a duplicate key exception.
SharePoint 2817429​ Developers are unable to specify   a Content Type ID when creating Content Types in the client object model.
SharePoint 2817429​ On list views in SharePoint   sites, the Connect to Outlook button in the ribbon may be erroneously   disabled.
SharePoint 2817429​ In some non-English languages of   SharePoint, the text displayed in the callout UI for a document or list item,   describing who last edited the item, may not be grammatically correct.
SharePoint 2817429​ Copy and Paste in a datasheet   does not work correctly with Internet Explorer 11.
SharePoint 2817429​ Pages do not render in Safari   for iPad when private browsing mode is used.
SharePoint 2817429​ When editing rich text fields in   SharePoint, if the editing session exceeds 30 minutes, the edits may not be   saved.
SharePoint 2817429​ An error that says   “SCRIPT12004: An internal error occurred in the Microsoft Internet   extensions” may occur intermittently when users visit their SkyDrive Pro   or other pages on their personal site.
SharePoint 2817429​ InfoPath may crash when a form   that points to a SharePoint list, with a lookup to another SharePoint list,   is opened.
SharePoint 2817429​ An InfoPath form with extended   characters in its name fails to open.
SharePoint 2817429​ An error that says   “Security Validation for the form has timed out” may occur when an   InfoPath form is digitally signed and hosted in a SharePoint site collection   that uses the SharePoint version 2010 user experience.
SharePoint 2817429​  “Show document icon” remains   unchecked and the document icon does not show in Edit Properties for a list   item.
SharePoint 2817429​ A “Failed tagging this   page” error occurs when the “I like it” button is clicked.
SharePoint 2817429​ The wrong term is removed when   manually editing a multi-valued taxonomy field.
SharePoint 2817429​ When tagging list items using a   language that is different from the term store default language, suggestions   for labels are offered in multiple languages. The suggestions appear   confusing because both language suggestions are listed without any identification   of the language.
SharePoint 2817429​ An error that says “There   was an error processing this request” may appear when editing the user   profile.
SharePoint 2817429​ Times are missing from Date/Time   results in certain filtered list web service calls.
SharePoint 2817429​ Minimal and no metadata are now   enabled as supported JSON formats.
SharePoint 2817429​ Actions4 schema workflow actions   can’t be deployed to SharePoint.
SharePoint 2817429​ Using Client Object Model,   Stream.Seek() to seek to a particular position doesn’t seek at the proper   offset.
SharePoint 2817429​ Refreshing a workflow status   page generates the following error:   “System.Collections.Generic.KeyNotFoundException: The given key was not   present in the dictionary.”
SharePoint 2817429​ Setting custom, non-English   outcomes in web pages on tasks in a workflow fails to set the value.
SharePoint 2817429​ Configurations of SharePoint   using Azure Hybrid mode and Workflow Manager together can cause workflow   callbacks to fail.
SharePoint 2817429​ Workflow task processes on wiki   pages won’t start.
SharePoint 2817429​ Workflows won’t wait for changes   to content approval status fields.
SharePoint 2817429​ E-mails generated by workflow   cannot be disabled for approvals in SharePoint workflows.
SharePoint 2817429​ Workflows may fail to send an   e-mail or send too many e-mails.
SharePoint 2817429​ Association variables do not   update correctly for auto-start workflows.
SharePoint 2817429​ A KeyNotFoundException error may   occur in a workflow when the associated task list uses unique permissions.
SharePoint 2817429​ Incomplete tasks are deleted   when workflow task activities complete.
SharePoint 2817429​ Task activity is suspended when   the task is completed using app-only credentials.
SharePoint 2817429​ An error that says “This   task could not be updated at this time” occurs when trying to complete a   workflow task using the “Open this task” button in Outlook.
SharePoint 2817429​ A workflow doesn’t respond   properly when waiting for changes in specific types of list columns, such as   Boolean, Date Time, and User.
VN:F [1.9.22_1171]
Rating: 9.7/10 (3 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

SPUtility.GetGenericSetupPath is obsolete, long live SPUtility.GetCurrentGenericSetupPath & GetVersionedGenericSetupPath

Whenever you are in a scenario where you need the location to the SharePoint root directory on the server in the farm that is executing your code, do NOT hardcode the path like the example below:

Bad practice:

private const string rootfolder = "C:\\Program Files\\Common Files\\Microsoft Shared\\web server extensions\\14\\";

The location of the SharePoint root directory depends on the configuration during the installation of SharePoint, your code will break if this configuration is different.

As you probably already know, it is a recommended practice to use GetGenericSetupPath available in the static SPUtility class. Please be aware that this method is obsolete in SharePoint 2013 and we have 2 new methods:

This will help you to make sure that your code is generic enough to deal with all scenario’s. For example with site collection upgrade.

Hope it helps!

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)