Skip Ribbon Commands
Skip to main content
Personal experiences and findings related to SharePoint.
April 02
Remove Global Navigation, Quick Launch, Title, and Breadcrumbs on Web Part Page

In SharePoint 2010, a web part web page will still show the global navigation, title and breadcrumbs.  Depending on the type of site, it will also still show the Quick Launch (for publishing sites).

You can remove all of these at once by placing this CSS in a Content Editor or HTML Form Web Part:

<style type="text/css">

#s4-ribbonrow, .ms-cui-topBar2, .s4-notdlg, .s4-pr s4-ribbonrowhidetitle, .s4-notdlg noindex, #ms-cui-ribbonTopBars, #s4-titlerow, #s4-pr s4-notdlg s4-titlerowhidetitle, #s4-leftpanel-content {display:none !important;}

.s4-ca{margin-left:0px !important; margin-right:0px !important;}


BEWARE! If you remove the ribbon, it's hard to get into Edit mode.  Just append this to your page URL:

August 10
Default a Selection on a Multi Choice Check Box Control on a Nintex Form

​I have a Nintex form (SharePoint 2010 / Nintex Forms 2010) with a Choice Control that has a lookup to another list.  This control is set to have a display format of check boxes (mulitple-selection).  I want the first selection to be checked by default when a new form is opened.

I am not a JavaScript expert, but I am very good at copying code and pretty decent at figuring it out.  I found a forum post that had the answer to my question.

Here are the steps:

  1. In the Choice Control settings, make sure that the Display format is set to Check boxes (Multiple-Selection).


  2. In the Advanced section, set Store Client ID in JavaScript variable to Yes.

  3. After this is set to "Yes", the Client ID JavaScript variable name field appears.  


  4. In this field, enter a variable name.  This name will be used in the JavaScript code that you will enter into the Form Settings.  (I like to prefix all variables with "var".)

  5. Click Save.

  6. From the Nintex Forms toolbar, click Settings.

  7. Expand the Custom JavaScript section and enter the following code:


    NWF$(document).ready(function() {
    NWF$("#" + varIssue).val('1');
    } );

  8. Change "varIssue" to your variable name that you entered in Step 4.  (If you want a different checkbox selected other than the first, change the number "1" in "val('1')" to a different number.  The number represents the list order of the options.)

  9. Click Save.

  10. Preview your form.

  11. The box has a check!


May 22
"File is locked for editing by..."

I had a user that had made edits to a file and checked it back in. Other users were trying to open the file and make edits, but were receiving the error on edit that the file was locked for editing by the original user.

Ultimately, I had to run some Powershell to unlock the file manually.  I found these commands on this blog​.

To see the details of the file lock/confirm the file is locked:

$web = Get-SPWeb 
$list = $web.Lists["DocLib"] 
$item = $list.GetItemById(2) 
​$file = $item.File 

To impersonate the user who has the lock and unlock the file:

$web = Get-SPWeb 
$list = $web.Lists["DocLib"] 
$item = $list.GetItemById(2) 
$file = $item.File 
$userId = $file.LockedByUser.ID 
$user = $web.AllUsers.GetByID($userId) 
$impSite= New-Object Microsoft.SharePoint.SPSite($web.Url, $user.UserToken); 
$impWeb = $impSite.OpenWeb(); 
$impList = $impWeb.Lists[$list.Title] 
$impItem = $impList.GetItemById($item.ID) 
$impFile = $impItem.File 
May 17
How to Get First Day of Last Week for Report Parameter SSRS 2008 R2

I needed to make a report parameter that would apply conditional formatting to my tablix based on a date range of the previous week start and end dates.

Start Date of Last Week:


End Date of Last Week:

May 05
How to Get Month Name When You Only Have Month Number (SQL View)

I on​ly have the month's number and not a full date.  I need to use both the month's number and the name in a SSRS parameter.  (I sort by the number and display the name.  I then filter my dataset on the month number.)

Here's the trick!

SELECT distinct [MonthofYear], DateName(mm,DATEADD(mm,MonthofYear - 1,0)) as MonthName
Order By MonthofYear

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"



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:



To show currency in ##.## format, 1-199 before the decimal and 2 digits after the 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).


Days of the Month

To allow numbers 1-31 to be entered.


Valid Year

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


Valid Zip Code

To allow 00000-99999 to be entered.


Number Range

To allow numbers 1-160 to be entered.


(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")


I did find this formula that worked!


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
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!)

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).












1 - 10Next