Wednesday, 28 September 2011

Displaying a User field in a Content Query Web part (CQWP)

Well it has been a little while since i have posted but hopefully now i will pick up where i left off  with the addition of the SharePoint 2010 world too.

I have been working on a 2007 environment recently and in particular a content query web part which is being used to display document information across an entire site collection based on a hierarchy of content types, so i set about the normal method of adding the CQWP to a page, exporting it, customising, adding in the custom xsl (ItemStyle, ContentQueryMain and Header) and then uploading to the webpart gallery and adding to a page.

All pretty easy stuff really…………….well.

A problem came about when i tried adding in a Site Column called “Document Owner” which was of type User.  I went about adding in the column to the CommonViewFields section of the .webpart, adding in a reference to Document_x0020_Owner,User;.  This caused the webpart to throw an error and fail completely.  I then searched many forums and blogs and tried a multitude of “solutions” including setting CommonViewFields reference to Document_x0020_Owner,Text; also trying the viewfieldsoverride property which turned out to be too restrictive, and nothing worked for me.  

After some more frustrating investigation and trials and errors, the answer as unbelievably simple.  Omit the identifier from the CommonViewFields property so it only looks like this.

<property name="CommonViewFields" type="string">Document_x0020_Owner;</property>

I also put in an entry into the DataColumnRenames property too, like so to make it easier to pick up in the xsl

<property name="DataColumnRenames" type="string">Document_x0020_Owner,DocumentOwner;</property>

then in your ItemStyle.xsl file, make reference to this field as follows (I setup a variable to achieve this), this removes the ID from the output which normally appears as 1;#morgan,gavin

<xsl:variable name="DocumentOwner"> 
<xsl:value-of select="substring-after@DocumentOwner, ';#')" /></xsl:variable>

<xsl:value-of select="$DocumentOwner" />

Hope that saves some others pain…….

Thursday, 13 May 2010

SharePoint Designer 2007 workflow SendEmail notification failed for SharePoint Groups

Came across a problem the other day where i had a SharePoint Designer workflow which sent a notification out to a SharePoint Group but failed.   The workflow was fine sending out notifications to individuals, it just wouldn’t send out to a group, it would report an error “The e-mail message cannot be sent. Make sure the outgoing e-mail settings for the server are configured correctly”  which is a bit of a red herring as there is nothing wrong with the email settings.

After a bit of digging around, i found the following fixes which resolved the issue.  It was actually to do with some of the permissions of the group I was using to send the email to, so you need to amend some of the settings on the group.

Firstly, Navigate to the site in question, click on Site Actions -> Site Settings -> People and Groups. Select the group that you are using to send the email to from the left navigation.  Then click on Settings -> Group Settings.

clip_image002

Secondly, make sure that the group that you are using to send an email to has at least “Read” permissions on the Site where you created your SharePoint designer workflow.

clip_image002[6]

Finally, within the Group settings section, make sure that “Everyone” can view the membership of the group.

clip_image002[4]

hope that helps a few people out….

Thursday, 22 April 2010

Recurring Meeting Workspace date picker JavaScript error

If you have a custom master page on your meeting workspaces (replaced MWSDefault.master), then you may encounter a JavaScript error for selecting a data from the left navigation if you setup a recurring meeting for that workspace.

clip_image002

To fix this issue open the custom master page (in SharePoint Designer if need be) and insert the following line below all of the other Register Tags and before the HTML tag starts

<%@ Register Tagprefix="Meetings" Namespace="Microsoft.SharePoint.Meetings" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

next insert the following line directly below the <Body> tag.

<Meetings:PropertyBag runat="server"/>

After this publish your master page and all meeting workspaces should now work.

Monday, 8 March 2010

GEMSolution Blog has Switched to Google Blogger

GEMSolution Blog “Share”….that’s the “Point” has now moved to Google’s Blogger tool.

I will shortly be uploading all historic blogs from the old blog site and putting a redirect in place on the old blog site so people are redirected here automatically.

Wednesday, 20 January 2010

Contains operator missing in Advance Search Web Part

This is an old topic, and i know it has been covered by some other people, but it is one i keep having to rectify in various client environments, so thought i would give myself an easy reference point for it rather than keep trawling the web each time.

So you have added the advance search Web Part to a page and the only two options which exist in the operator drop down (see below) are “Equals” and “Does not equal”.  So where has the “contains” and “does not contain” operator gone.  

Monday, 4 January 2010

Happy New Year

Just thought I'd send a quick post to wish everyone who reads my Blog a very Happy New Year.  I am looking forward to an exciting 2010 with plenty of new technologies to dive into with SharePoint 2010 and Visual Studio 2010 at the top of my list.

Over the Christmas period i managed to get a SharePoint 2010 beta server up and running so i will be putting up some posts on my findings whilst playing around.

I Will also be looking into Visual Studio 2010 and how well it integrates and caters for SharePoint development.

Watch this space………..

Friday, 13 November 2009

Setting ModerationInformation.Status back to pending removes author/creator permissions

Here’s the scenario – I have a visual studio sequential workflow on a list (not document library) which has a 2 stage approval process.  The request was to use the standard OOB approve/reject mechanism rather than tasks, so for the first stage of approval, the approver would select Approve/Reject from a list item.  Once the first stage approver approves the item, the item should NOT be approved and live, but still pending and an email sent to the 2nd level approver to make the ultimate decision of making the item live.  Once the 2nd stage approver approves the item the item then becomes Approved and Published for all to see.
I created a Visual Studio Sequential Workflow and created separate routes through workflow based on who updated the List Item.