Skip Ribbon Commands
Skip to main content
Home
Personal experiences and findings related to SharePoint.
April 12
How to Change the Home Page URL on SharePoint 2010 Team Site

I have a SharePoint 2010 team site that I didn't want to use the "Wiki Home Page" option and didn't want to turn on publishing.  I simply wanted to change the default home page URL from http://site/default.aspx to http://site/pages/home.aspx.​  (This home page uses a tabbed interface for an app-like feeling.)

I found this post​ which provided the Powershell to make the change:

Add-PsSnapin Microsoft.SharePoint.PowerShell 

$w = get-spweb http://yoursite

$r = $w.RootFolder

$r.WelcomePage = "Pages/Home.aspx"

$r.Update()

$w.Dispose()

It worked beautifully!  Now, when using the breadcrumbs, or the Site Name as a link back to the home page of the site, it always goes to this home page.
March 30
Nintex Form Field Validation Expressions

I'm just learning Nin​tex Forms and found out that a SharePoint field control, such as a number field set to two decimals, comes over on the Nintex form as a Single Line Textbox control and doesn't respect the SharePoint field settings!  So, the user can type in alpha characters, 500 numbers after the decimal, etc.  Annoying!

So, here are some of my common expressions used in the Validations section of the Control Settings of the Single Line Textbox SharePoint field control:

NintexControlSettings.jpg

Currency

To show currency in ##.## format, 1-199 before the decimal and 2 digits after the decimal.

^([1][1-9][0-9]|[1-9][0-9]|[0-9])((\.)[0-9][0-9])$

Decimal

To show a number in #.## format where the decimal is optional, allowing 1-2 digits before the decimal and 1-2 digits after the decimal (optional).

^[1-9][0-9]{0,2}(?:\.[0-9]{​0,2})?$​

Days of the Month

To allow numbers 1-31 to be entered.

^(3[01]|[12][0-9]|[1-9])$​​

Valid Year

To allow a valid 4-digit year between 1900-2099.

^(?:(?:19|20)[0-9]{2})​​

Number Range

To allow numbers 1-160 to be entered.

^([1-9]|[1-8][0-9]|9[0-9]|1[0-5][0-9]|160)$​

(It's easiest to use this Number Range Generator​. Just remember to include the carat (^) at the beginning and the dollar symbol ($) at the end.)

Here's a great reference​ for Regular Expressions that I used to build mine above.
​​
February 28
Calculating Week Number in Calculated Field

I needed to calculated the week number based off the Created date.  

I found many blog and forum posts using the formula below, but it kept adding 5 weeks.  I think it had something do to with my regional settings ("Define Your Work Week")

=INT((Created-DATE(​YEAR(Created),1,1)+(TEXT(WEEKDAY(DATE(YEAR(Created),1,1)),"d")))/7)+1​

I did find this formula that worked!

​=INT((Created-DATE(YEAR(Created-WEEKDAY(Created-1)+4),1,3)+WEEKDAY(DATE(YEAR(Created-WEEKDAY(Created-1)+4),1,3))+5)/7)​

February 08
Formatting a Date Field in Nintex Form SQL Request Control

I needed to return a date in a SQL query using the Nintex Form SQL Request Control.  I can do this via a simple SQL query. However, the returned format is:

10/31/2016 12:0​0:00 AM

I need it to be 10/31/2016.

Yes, I can create a calculated control to format this SQL Request Control, but then I have to "hide" the control and only display the calculated control. What a pain!

I found that I can convert the date field in the SQL query to the format I need!​

SQL query before:

Select EnrollmentStartDate
V_ActiveSEParticipantEnrollment
Where ParticipantID='SQLID_Participant'

SQL query after:

Select convert (varchar, EnrollmentStartDate, 101) AS EnrollmentStartDate
From V_ActiveSEParticipantEnrollment
Where ParticipantID='SQLID_Participant'

​Both the Value and Display field in the SQL Request Control settings are "EnrollmentStartDate".

Here's the reference to the date formats used in the Convert command. (The number referenced after the field.)
December 23
Hide Green Plus Button on Inline Editing View

I want to hide the green "plus" button at the bottom of an inline editing view on a list.  In fact, I really want to use this view in a Nintex List View control.  So, even if I remove the icon via SharePoint Designer, the Nintex List View control still renders it. (I know...odd!)

GreenAddPlus.jpg
I found this forum post with a simple jquery/CSS solution that worked perfectly!  Just add this code into a Content Editor Web Part on the page (hide the web part).

<script

src="http://code.jquery.com/jquery-1.10.2.min.js"

type="text/javascript">

</script>

<style

type="text/css">

.ms-listviewtable

 img[alt='New']{

   display:none;

}

</style>

November 22
Run a Workflow on a List Via Powershell

Use this Powershell script to run a specific workflow on a specific list:

# URL of the Site

$web = Get-SPWeb -Identity "https://sharepointsrv/site1"

$manager = $web.Site.WorkFlowManager

# Name of the list

$list = $web.Lists["Shared Documents"]

# Name of the Workflow

$assoc = $list.WorkflowAssociations.GetAssociationByName("On Item Created","en-US")

$data = $assoc.AssociationData

$items = $list.Items

foreach($item in $items)

 {

 $wf = $manager.StartWorkFlow($item,$assoc,$data,$true)

 }

$manager.Dispose()

$web.Dispose()

#

I used to have to make a change to every list item (using Datasheet view) to force the "on update run the workflow".  However, sometimes this doesn't work if the item doesn't have all required fields completed. 

​Thanks to this blog post​ for this script. It worked like a charm for me!
November 10
External Content Type Field Not Displaying In Grouping View

I have a grouping view that is using an external content type as the grouped field.  This field is not being displayed:

ExtConTypeGrouping.jpg

​I had to create a calculated column that pulled in the value of the external content type column, then I could group on the new calculated column.

October 05
"Trying to use an SPWeb object that has been closed or disposed and is no longer valid." Error When Creating New Best Bet

On my SP 2010 farm, I was trying to create a new best bet on my intranet site collection.

Here were my steps:

  1. From the Manage Keywords page, I clicked "Add keyword".
  2. In the Keyword Phrase field, I typed "Core Values".
  3. In the Synonym field, I typed "mission;vision".
  4. In the Best Bets section, I clicked Add Best Bet.
  5. On the Add Best Bet dialog, I selected Add new best bet and entered the URL and Title and clicked OK.
  6. Back on the Add Keyword page, I clicked OK and received this error: 

    SPWebDisposeError.jpg
​I could have sworn I've done this a hundred times!!!

I found on this forum post​ that if you add the keyword without the synonyms, you don't receive this error.  You can go back and edit the keyword and add the synonyms.
September 14
Speaking at SharePoint Saturday Charlotte!

It's been quite some time since I've spoken at a conference, or even user group.

On Saturday, September 17, 2016, I'll be at SharePoint Saturday Charlotte. Here's my session: 

A Peek Into Real Life Business Solutions

Level: 100

Track: IT Pro, End-User, Business

Have you ever wanted to see how someone else did "it", outside of standard intranet content or a document management solution? Come to this session to learn about business obstacles and how they were solved using SharePoint out-of-the-box tools, including SharePoint Designer, InfoPath, SQL Reporting Services, and custom SQL databases (for full-blown application-style solutions). Some solutions will include a "lite" learning management system, logistics tracking application, employee recognition nomination and approval, program application and attendance tracking, and many more.

Presentation​

August 31
Search Not Returning Results/"Server Error"

​All of a sudden, our enterprise search center stopped working. When you tried running a search, it would eventually timeout with a generic "server error".

ULS logs showed this error:

(Watson Reporting Cancelled) System.Net.WebException: The remote server returned an error: (503) Server Unavailable.    

 at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)    

 at Microsoft.Office.Server.Search.Query.HttpAsync.RespCallback(IAsyncResult asynchronousResult)

Just below this error, followed this one:

(Watson Reporting Cancelled) System.Threading.ThreadAbortException: Thread was being aborted.    
 at System.Threading.Thread.AbortInternal()    
 at System.Threading.Thread.Abort(Object stateInfo)    
 at System.Web.HttpResponse.End()    
 at System.Web.HttpServerUtility.Transfer(String path)    
 at Microsoft.SharePoint.Utilities.SPUtility.TransferToErrorPage(String message, String linkText, String linkUrl)    
 at Microsoft.Office.Server.Search.WebControls.QueryUIError.GetErrorMessageOrRedirectToErrorPage(Exception ex, Boolean showMessages)    
 at Microsoft.Office.Server.Search.WebControls.CoreResultsDatasourceView.GetXmlResponseDoc(DataSourceSelectArguments selectArguments)    
 at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.GetXPathNavigator(String viewPath)

After reading many blogs and forum posts on the first one, which all pointed towards an IIS app pool not being started (which wasn't my issue), I realized that other scopes worked, including my People scope which uses the PeopleResults.aspx page. My default scope, All Sites, uses Results.aspx. This page was not working.  

Thinking about the "server unavailable" erorr in the ULS logs, I went to the Results page in Edit mode. I had an "Internet Search Results" web part which was really just a Search Core Results web part with the configuration set to internet search results.  (See this Technet article​ for details on setting this web part.)  I removed this web part. VIOLA! Issues solved! 

So, whatever site this "internet search" uses, must have been down, or no longer exists.  
1 - 10Next