Nintex Workflow 2010 – The workflow could not update the item, possibly because one or more columns for the item require a different type of information.

While trying to set field value or update list item action after set item permissions for setting workflow initiator’s permission to read only so that he or she could not modify the list item I was getting the following error in email.

The workflow could not update the item, possibly because one or more columns for the item require a different type of information.

On the workflow status page in the history list an event was logged with Error event type and outcome of that event was access denied.

After exploring a little bit I found out that this error was coming because Nintex workflow runs in the user context of initiator so if the initiator doesn’t have permission to modify list items set field value and update list items actions would fail.

There is a way to run the workflow in the context of user who publishes it. Thia option can be enabled by editing an action, go to common settings and then enable “Run as workflow owner”. This option is not available in all actions so to use it in actions where it is not available please drop an action set action in the workflow, enable this setting and then drop the actions you want to use, in my case I was using state machine workflow and then was using set field value.

image

I hope you find this post useful. Thanks for reading.


Powershell to create calendar in SharePoint with categorized overlays

Creating calendars in SharePoint 2010, changing default categories and then creating view and overlay for each category can take a lot of clicks. To save time and effort I created a powershell script which can be used as follows

& ‘.\Calendar Overlay.ps1′ -webUrl {SITEURL} -listName “{LISTNAME}” -categories “{CommaSeparatedCategories}”

It takes three command line parameters which are

-webUrl – The site url where you want to create the calendar

-listName – The name of calendar list

-categories – Comma separated values for categories

For example if you would like to create a calendar named Yearly events on http://myspsite/marketing with road show, marketing boot camp 1 and digital campaign 1. You can pass in the following arguments

& ‘.\Calendar Overlay.ps1′ -webUrl http://myspsite/marketing -listName “Yearly Events” -categories “Road show, Marketing Boot camp 1, Digital Campaign 1″

The resulting calendar would look like

Calendar overlays created with Powershell

Source for the script is as follows:

###############################################################################
# Creating Calendar overlays in SharePoint 2010 using Powershell
# Version          : 1.0
# Url              : https://khurrampunjwani.wordpress.com
# Creator          : Khurram Punjwani, http://twitter.com/khurrampunjwani
###############################################################################

param (
    [string]$webUrl = $(throw "-webUrl is required."),
	[string]$listName = $(throw "-listName is required."),
    [string]$categories = $(throw "-categories is required.")
 )

[array]$categoriesArray = $categories -split ","

Function Get-SPCalendarWeb(){

	#Clear screen first
	Clear-Host
	
	#Load web where Calendar is supposed to be created
	$web = Get-SPWeb -Identity $webUrl
	Write-Host "SP Web Loaded " $web.Title
	
	#Create new calendar
	New-SPCalendar

	$web.Dispose()
}

Function Add-TestEntries($cal){
	$listItem = $cal.AddItem()
	$listItem["Title"] = "Test 1"
	$listItem["Category"] = $categoriesArray[0]
	$listItem["EventDate"] = [System.DateTime]::Now
	$listItem["EndDate"] = [System.DateTime]::Now.AddHours(4)
	$listItem.Update()
	
	$listItem = $cal.AddItem()
	$listItem["Title"] = "Test 2"
	$listItem["Category"] = $categoriesArray[1]
	$listItem["EventDate"] = [System.DateTime]::Now
	$listItem["EndDate"] = [System.DateTime]::Now.AddHours(4)
	$listItem.Update()
}

Function New-SPCalendar(){
	$web.Lists.Add($listName,"",[Microsoft.SharePoint.SPListTemplateType]::Events)
	$cal = $web.Lists.TryGetList($listName);
	
	Write-Host "Calendar created"
	
	#Delete default categories and add the ones specified in command line
	Add-CalendarCategories $cal
	
	#Add Views with Filters
	Add-SPCalendarViews $cal

	#Add test entries
	Add-TestEntries $cal
}

Function Add-SPCalendarViews($cal){
	$view = $cal.Views["Calendar"]
	$viewFields = $view.ViewFields.ToStringCollection()
	$viewData = ""
    $viewData += ""
    $viewData += ""
    $viewData += ""
    $viewData += ""
	#XML for calendar overlays
	$calendarSettings = "  "
	#To show different color for category views
	$colorIndex = 1 
	
	#Create views for categories so there will be one view for each category
	foreach($category in $categoriesArray){
		#Create filter for the view to show events from the respective category
		$viewQuery = ""
		$viewQuery += ""	
		$viewQuery += ""
		$viewQuery += ""
		$viewQuery += ""
		$viewQuery += ""
		$viewQuery += ""
		$viewQuery += ""
		$viewQuery += ""
		$viewQuery += ""
		$viewQuery += %{"{0}" -f $category}
		$viewQuery += ""
		$viewQuery += ""
		$viewQuery += ""
		
		$newView = $cal.Views.Add($category,$viewFields,$viewQuery,3,$false,
			$false,"CALENDAR",$false)
		$newView.ViewData = $viewData
		$newView.Update()

		%{"View created for {0} category" -f $category} | Write-Host
		
		#Update XML for Calendar Overlay, each view would be added as an overlay
		$calendarSettings += %{"  " -f $category}
		$calendarSettings += %{"

Getting authentication prompt again and again while trying to access #SharePoint 2010 Rest Interface

While trying to access to ListData.svc service in a SharePoint 2010 sub site I was getting authentication prompt to enter credentials again and again. I was using a SharePoint Farm administrator account so was sure that permission is not the cause of this problem. So I started SharePoint Manager, browsed to the sub site and saw that there was a problem in a feature

SharePoint Manager Site Feature List

Afterwards I checked in the list nodes of the same site to see which lists were included in this missing feature, after clicking on one of the lists I got the following error which hinted that this list was the one included in the feature.

SharePoint Orphaned list exception

Further in the properties window there was an error message in the content type field

SharePoint Manager List Properties

I deleted this orphaned lists and the service worked fine then.

I hope you found this post helpful. Thanks


Download links for Office Server 2010 and #SharePoint 2010 Service Pack 2 (#SP2) Packages

SharePoint Service Pack 2 (SP2) has been officially released. It was published on 21st July 2013 and contains new updates which improve security, performance, and stability. Please refer the SP2 change list for complete list of fixed issues.

This service pack includes all cumulative updates (CU) from June 2011 till April 2013 and public updates (PU) from July 2011 till May 2013 which were released after Service Pack 1 (SP1)

To download, please click the following links.

Microsoft SharePoint Server 2010 Service Pack 2 KB2687453
Microsoft SharePoint Foundation 2010 Service Pack 2 KB2687464
Microsoft SharePoint Foundation 2010 Language Pack Service Pack 2 KB2687466
Microsoft FAST Search Server 2010 for SharePoint Service Pack 2 KB2687446
Microsoft Search Server 2010 Service Pack 2 KB2687461
Microsoft 2010 Server Language Pack Service Pack 2 KB2687462
Microsoft Office Web Apps Service Pack 2 KB2687470
Microsoft SharePoint and Project Server 2010 Service Pack 2 KB2687452
Microsoft Groove Server 2010 Service Pack 2 KB2687448
Microsoft SharePoint 2010 Indexing Connector for Documentum Service Pack 2 KB2687459
Microsoft Duet Enterprise for SharePoint and SAP Service Pack 2 KB2687445
Microsoft SharePoint Designer 2010 Service Pack 2 (64-bit) KB2687463
Microsoft SharePoint Designer 2010 Service Pack 2 (32-bit) KB2687463

Please note June 2013 CU is not included and has to be installed separately. To download it, please click the following links.

SharePoint Foundation 2010 June 2013 CU

SharePoint Server 2010 June 2013 CU

Thanks for reading and have a nice day. Cheers


Changing SharePoint 2010 lookup column Date Time and Number formatting

Few days back I was creating a report using SharePoint 2010 list as data source in Report Builder 3. The list I was using had the following lookup columns:

  • StartDate (DateTime Column)
  • FinishDate (DateTime Column)
  • Budget (Number)

Now when I tried to change the datetime and number formatting, I noticed formatting was not being applied.

After spending some time I found out that in order to apply number and datetime formatting to lookup columns, they must be converted to a proper data type. So instead of binding field directly to a column, I used the following expressions to convert these lookup columns in proper data types

Convert SharePoint 2010 lookup column to proper data type

The complete list of conversion functions can be found under Common functions and then Conversion. In my case for dates I used CDate(FieldName) and for number column I used CInt(FieldName)

Convert SharePoint 2010 lookup column to proper data type


Why AutoSPInstaller?

Let’s assume we’ve to create a new SharePoint 2010 server so we install SharePoint 2010 and then start the configuration wizard. After we’re through with the configuration wizard, most probably when we’ll start SQL Server Management Studio we’ll see something like the following

SharePoint Databases with Guids

This type of inconsistent naming can be very unpleasant and might not be very handy for our DBAs, wouldn’t it be better if we’d something like

So what we do. We can run some powershell scripts to manually configure our Farm and install services (For more details, please visit http://technet.microsoft.com/en-us/library/cc262839.aspx#section6)

Another good alternate is that we use AutoSPInstaller which can automate the process of installing (including downloading and installation of pre- requisites) and configuring SharePoint 2010 based on inputs we provide in an xml file. There is an editor available to edit scripts for AutoSPInstaller as well called AutoSPInstallerGUI

For detailed instructions on how to use AutoSPInstaller, please visit http://www.softlanding.ca/Blog/Lists/Posts/Post.aspx?ID=30.

Thanks for reading. I hope you found this post useful. Please don’t forget to share this post. Cheers


Changing SharePoint 2010 search box icon using CSS

There are a few ways to change the search box icon like specifying image URL by creating or using existing delegate control and another way to change it on runtime using JavaScript but there is another simpler way so let’s explore it and look at the html for icon which is being generated by the SmallSearchInputBox html control

<a href="javascript:S3031AEBB_Submit()" title="Search" id="ctl00_PlaceHolderSearchArea_ctl01_S3031AEBB_go">
<img style="border-width:0px;" src="/_layouts/images/gosearch15.png" alt="Search" class="srch-gosearchimg" onmouseout="this.src='\u002f_layouts\u002fimages\u002fgosearch15.png'" onmouseover="this.src='\u002f_layouts\u002fimages\u002fgosearchhover15.png'" title="Search">
</a>

We can see that there is an inline img tag inside an anchor tag so if we set the img tag display’s to none and specify background image for the anchor we can easily change icon so let’s try this out. To apply the following CSS, we’ll have to create a CSS in Style Library in which we’ll override default styling and specify it as an alternate CSS in Master page site settings.

td.ms-sbgo
{
padding:0px 3px 0px 3px;
}

td.ms-sbgo a
{
    background-image: url(/Style%20Library/Images/our_search_button.png);
    background-repeat: no-repeat;
    background-position: top left;
    display:block;
    width:20px;
    height:19px;
}

td.ms-sbgo a img
{
    display: none;
}

Follow

Get every new post delivered to your Inbox.

Join 174 other followers