Sunday, February 22, 2015
Sharepoint 2013 - showing Task Due Date in Content Query Web Part (CQWP)
To get the Due Date of a task to appear in a content query web part you need to configure the web part to use 'TaskDueDate', not 'DueDate'. This then resolves in the web part to Due Date [Core Task and Issue Columns].
Visual Studio stuck on "Waiting for parse to complete..."
Today when I opened my sharepoint 2013 solution in Visual Studio 2013 it got stuck loading a project with the message in the status bar of "Waiting for parse to complete...". Yesterday before I closed visual studio I was looking at a large xsl file which I had left open before closing visual studio. I think this may have been the file it was stuck on?
The way I fixed it was to remove the mapping in Visual Studio to the solution and re-add it in Source Control Explorer. To remove mapping:
The way I fixed it was to remove the mapping in Visual Studio to the solution and re-add it in Source Control Explorer. To remove mapping:
- Backup your source code to another folder
- go to Source Control Explorer
- right click on the folder that contains the solution
- Go to Advanced > Remove Mapping...
Monday, February 16, 2015
Visual Studio - display selected file in solution explorer
Everytime I need to set this up I can't remember how.
It is very handy when you have a Visual Studio project with a large number of files to have the file you are working on highlighted in the solution explorer. This doesn't happen automatically but is super easy to set up.
Done!
It is very handy when you have a Visual Studio project with a large number of files to have the file you are working on highlighted in the solution explorer. This doesn't happen automatically but is super easy to set up.
Tools > Options > Projects and Solutions > General > Track Active item in Solution Explorer
Done!
Monday, February 9, 2015
User Profile Synchronization Service
That old gem of getting the user profile synchronization service running bit me today. Thanks so much to SharePointBjorn for supplying the powershell script to fix it.
Sunday, February 8, 2015
SharePoint 2013 - Creating a view to show tasks assigned to me and groups that I am a member of
I have a requirement to create a view to show tasks that are:
The Where clause for the view needs to be:
And that is all.
- assigned to me, and
- assigned to groups that I am a member of
The Where clause for the view needs to be:
<Or> <Membership Type="CurrentUserGroups"> <FieldRef Name="AssignedTo"/> </Membership> <Eq> <FieldRef Name="AssignedTo"/> <Value Type="Integer"> <UserID/> </Value> </Eq> </Or>
And that is all.
Wednesday, February 4, 2015
SharePoint 2013 - Adding a ListViewWebPart throws error "The specified view is invalid"
Today I encounted an issue where I was programatically adding a ListViewWebPart to a page and getting an exception "The specified view is invalid".
The code throwing the exception was
The solution was to change ListViewWebPart to XsltListViewWebPart. Once I did that the problem went away.
The code throwing the exception was
var listViewWebPart = new ListViewWebPart { ListId = list.ID, ChromeType = PartChromeType.None, ViewGuid = list.Views[Constants.ViewNames.DocumentLibraryAllDocumentSets].ID.ToString("B").ToUpper() }; webPartManager.AddWebPart(listViewWebPart, "Top", 1);
The solution was to change ListViewWebPart to XsltListViewWebPart. Once I did that the problem went away.
Tuesday, February 3, 2015
Sharepoint 2013 - create mapped properties with powershell
It has been many years and a couple of versions of SharePoint since I posted and I figured it's time to resurrect SharePoint Wisdom. What better way to start than a sample powershell function that will add/edit a managed property and map a crawled property to it in SharePoint 2013.
I hope this script proves useful to someone.
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell" } Function UpdateManagedPropertyMapping([string]$managedPropertyName, [string]$crawledPropertyName, $searchApp) { $managedProperty = Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $searchApp -Identity $managedPropertyName -ErrorAction SilentlyContinue Write-Host Adding/Updating managed property $managedPropertyName if($managedProperty -eq $null) { #create a new property Write-Host Creating managed property $managedPropertyName $managedProperty = New-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $searchApp -Name $managedPropertyName -Type 1 -Queryable $true -Retrievable $true $managedProperty.Refinable = $true $managedProperty.Sortable = $true $managedProperty.Update() Write-Host Created managed property $managedPropertyName } else { Write-Host Managed property $managedPropertyName already exists } $managedPropertyMapping = Get-SPEnterpriseSearchMetadataMapping -SearchApplication $searchApp -ManagedProperty $managedProperty if($managedPropertyMapping) { #remove mapping Write-Host Removing existing mapping Remove-SPEnterpriseSearchMetadataMapping -Identity $managedPropertyMapping -Confirm:$false } Write-Host Mapping property $crawledPropertyName to $managedPropertyName $crawledProperty = Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $searchApp -Name $crawledPropertyName $managedPropertyMapping = New-SPEnterpriseSearchMetadataMapping -SearchApplication $searchApp -ManagedProperty $managedProperty -CrawledProperty $crawledProperty Write-Host Finished adding/updating managed property $managedPropertyName } $searchApp = Get-SPEnterpriseSearchServiceApplication UpdateManagedPropertyMapping FFBoKAuthor ows_Author0 $searchApp UpdateManagedPropertyMapping FFBoKPublicationYear ows_CategoryLevel1 $searchApp UpdateManagedPropertyMapping FFBoKCategory1 ows_CategoryLevel1 $searchApp
I hope this script proves useful to someone.
Subscribe to:
Posts (Atom)