Skip Ribbon Commands
Skip to main content
Home
Personal experiences and findings related to SharePoint.
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.  
January 18
Create Dataview Web Part to Display Data From a SQL Database View
I want to create a page in our intranet to be used like an "Associate Directory".  Key factors:  Not all associates are in Active Directory, but all are in a custom SQL database.

We need to use SharePoint Designer 2010 (SharePoint 2010 site) to create the datasource and dataview.

Create Datasource
  1. Open SharePoint Designer 2010 to your site which you want to create the page.
  2. From the Navigation pane, choose Data Sources.
  3. From the ribbon, choose Database Connection.

    DatabaseConnectionButton.jpg

  4. The Data Source Properties dialog appears.

    DataSourceConnection.jpg

  5. Click Configure Database Connection.
  6. From the Connect to Database Server page, enter the Server information and Authentication, or select to "Use custom connection string".

    ConnectToDatabaseServer.jpg

  7. Click Next.
  8. Choose the Database, Select a table or view, or specify custom commands.

    SelectDatabaseView.jpg

  9. Click Finish.  You are returned to the Data Source Properties dialog.

    DataSourceProperties.jpg

  10. By default, all fields are selected.  If you want to remove some, click the Fields button.
  11. If you want to apply a filter or sort, click the Filter or Sort button.
  12. Click OK.  The new data source has been created.
Create Page
  1. Create a web part page and save it to a library. 

    Note:  You cannot create Dataview web parts on publishing pages.  Instead, you will need to create a Web Part Page and add the web part to the new page. 
    1. From the Navigation pane, select All Files.
    2. Open the Pages library.
    3. All pages are displayed.
    4. From the ribbon, choose Web Part Page.  Choose the layout you want.

      NewASPX.jpg

  2. Click the newly created page to open its Settings pages for it.
  3. Under the Customization section, click Edit file.

    EditFile.jpg
Create Dataview Web Part
  1. With the page open in Split or Design mode, from the ribbon, choose Insert, Data View.  Under the Database Connections section, choose your new Data Source.

    InsertDataView.jpg

  2. A web part appears with a table that shows a few fields from the data source.

  3. Customize the fields, sorting, additional filters, and paging by using the ribbon in the Data View Tools section on the Options tab.  (Note:  The Data View web part must be highlighted for the correct ribbon menu to appear.)

    DataViewToolsOptions.jpg

    For my page, I did the following:

    • Sorted on Last Name, then First Name.
    • Created Conditional Formatting to shade odd rows with a grey background.
    • Set Paging to show 100 items per page.

  4. Now, I want users to be able to filter and sort on the column headers.  From the ribbon, choose the Data View Tools, Design tab.  Check Sort & Filter on Headers.

    SortFilteronColumnHeaders.jpg

  5. I also want the filters to appear on top of the column headers.  From the ribbon, choose the Data View Tools, Design tab.  Click Options, Grouping Toolbar.

    GroupingToolbar.jpg

  6. A new toolbar appears above your column headings.  (When the Filter button is clicked, it will show filter options above each column header.  When you click on the column header, it will sort in ascending order.  If you hover over the column header, you can perform a filter.)

    FilterToolbar.jpg

  7. Now, I do not want the Filter button, Sort by or Group by options to display, but I do want the filter options above each column header to appear.  This requires going into the Code view and commenting out a line of code.
  8. Either switch to Code view, or click in the Code pane of the Split view.
  9. Press Ctrl+F to perform a search.  Search for:

    <xsl:if test="$dvt_adhocmode = 'filter'" ddwrt:cf_ignore="1">

    FindCode.jpg

  10. Once this line of code is found, delete the line of code.


  11. Scroll down until you find the ending </xsl:if> tag and delete it.

    EndCommentCode.jpg

  12. When you preview the page, the filter options are enabled by default and the user does not need to click the Filter button.

    FilterChoices.jpg

  13. Now, I do not want the Hide Filter Choices, Sort by or Group by options showing. 
  14. Click inside each cell and delete the contents.  The filter choices still appear, but those options are gone.
  15. Now, I want to change both the column headers and the filter headers to be more descriptive and not use the database field names.
  16. To change the column headers, click inside the column header cell and manually change the text.  (Sometimes, I will change it in the Code view because it's faster.)
  17. To change the filter headers, scroll to the bottom of the code.  Just a few rows up (above the ending </table> tag), you will see code to display the headers.  The section in the Code pane will look something like this:

    ChangeColumnHeaders.jpg

  18. Change both the fieldtitle to the name you want.
  19. Scroll up and change the other fields if you want.
  20. Save the page.  You are all done!
If you are using publishing:

Once your Data View web part looks and acts like you want, you will need to export the web part and import onto your publishing page.

January 18
External Data Type Field Will Not Group In View

I have a list with an External Data Type field (goes to BCS connection to a SQL database view)​.

When I try to group by that column, it shows as an empty field. You can see below that the Requestor field has data, but the grouping field, which is the same field, does not.

RequestorEmpty.jpg

You can create a calculated column to show the External Data Type field.  (I created the new, "Requestor Name" field as a calcuated field.) Then, this field will group correctly. 

RequestorName.jpg

September 22
Calculated Date Doesn't Display Correct Date

We have a calendar.  We want a list to show only the mm/dd format (no time or year).  

I created a calculated column for =TEXT([Start Date],"MM/DD").  Seems easy, right?  NO!  The dates for all day events are coming out a day off.

I found this forum​ post about it.​ 

Basically, dates are stored in the SQL content database in GMT format so the time zone settings for the site or user can be adjusted.

Here's the formula to use so that it will properly adjust the time:

=IF(TEXT(([End Time]-[Start Time])-TRUNC(([End Time]-[Start Time]),0),"0.000000000")="0.999305556",IF([Start Time]=ROUND([Start Time],0),[Start Time],DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time])+1)),[Start Time])​

I modified this just a tad to include the formatting of the date to mm/dd.

=TEXT(IF(TEXT(([End Time]-[Start Time])-TRUNC(([End Time]-[Start Time]),0),"0.000000000")="0.999305556",IF([Start Time]=ROUND([Start Time],0),[Start Time],DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time])+1)),[Start Time])​​,"MM/DD")
September 08
Add List Search Box "Find an Item" To a Page

​In SharePoint 2013, the "Search this list" scope was removed and the "Find an item" search box was added to the list toolbar.

FindanItem.jpg

But, what if you add the list web part to a page and want to search just the list?

Well, when you add the web part, there is a property in the Miscellaneous section of the Web Part Properties pane, named "Display search box". When you check this option, the "Find an item" search box appears!  (You don't even need to show the list toolbar.)

Miscellaneous.jpg




August 19
What "Web Stuff" Turned Out to Be for Me

Check out my article​ on IT Unity's Women in Technology Community page.​ 

1 - 10Next