Tuesday, June 17, 2008

SharePoint RSS Viewer Error

Having added the SharePoint OOB RSS web part on to my site and configured it to point to a feed i received the following error in the log:

RssWebPart: Exception handed to HandleRuntimeException.HandleException System.Net.WebException: Unable to connect to the remote server

Found the solution here: http://yasirbutt.spaces.live.com/blog/cns!A8677D5751E6B4DA!1409.entry

The following needs adding to the site web.config file (at the bottom of the file):

<system.net>
<defaultProxy>
<proxy usesystemdefault = "false" proxyaddress="http://proxyservername" bypassonlocal="true" />
</defaultProxy>
</system.net>

Friday, June 13, 2008

The type or namespace name 'Publishing' does not exist in the namespace 'Microsoft.SharePoint'

I started playing around with a copy of default.master yesterday and added in a CssRegistration link to the header:

<SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/CustomMySiteRegistration.css %>" runat="server"/>

After deploying the master page to SharePoint i received the following error:

An error occurred during the processing of . c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\dff54803\4595fc0a\App_Web_custommysite.master_1096277560.2bgek7y-.0.cs(1389): error CS0234: The type or namespace name 'Publishing' does not exist in the namespace 'Microsoft.SharePoint' (are you missing an assembly reference?)

Thanks to Tom Meskens for posting the error here's the solution.
The default.master file doen't include the publishing assembly declarations required. They need to be added in as follows:

<%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="PublishingVariations" TagName="VariationsLabelMenu" src="~/_controltemplates/VariationsLabelMenu.ascx" %>
<%@ Register Tagprefix="PublishingConsole" TagName="Console" src="~/_controltemplates/PublishingConsole.ascx" %>
<%@ Register TagPrefix="PublishingSiteAction" TagName="SiteActionMenu" src="~/_controltemplates/PublishingActionMenu.ascx" %>


Republish the master page and hoorah - no more error!

Thursday, June 05, 2008

Submit InfoPath forms to SharePoint with unique filenames

This is a follow up to an issue that i initially encountered a couple of months ago when we first deployed an Infopath form to SharePoint. The original thread can be viewed here: SharePoint User Group UK

As Colin pointed out in his comment our approach left us open to the possibility of duplicate records since users could simultaneously open a new form and thereby taking the same last max id from the form library.

Although it appeared to users as though duplication was occuring, in reality the record is not duplicated because SharePoint asigns its own unique ID which automatically increments with each new record.

I have now updated the form as suggested by J_A_G, which also has the advantage of using no code.

This works by applying 2 rules to a hidden field on the form. Documents are assigned a unique filename based on the concat() function by concatenating fields in the form with the now() function. The rules determin whether or not the filename field is blank; if not it is not updated - without these rules each time a form is reopened and resubmitted it would be saved as a new form instance with a different filename as opposed to just updating an existing one.

Here's how to set this up:
  • Add a hidden field to the form called 'fileName'



  • Create a SharePoint Data Connection to set the InfoPath file name to the hidden field fileName
  • Check the box 'Allow overwrite if file exists'



  • Open Tools / Submit Options
  • Select radio button 'Perform custom action using rules'
  • Click the Rules button



  • Add Rule 1 (filename is blank)
    • Set condition 1: if fileName is blank
    • Set action 1: set field's value fileName = concat(myfield, now())
    • Set action 2: submit using a data connection: (the DC you created earlier)



  • Add Rule 2 (filename is not blank)
    • Set condition 1: if fileName is not blank
    • Set action 1: submit using a data connection: (the DC you created earlier)

Filtering MOSS lists with the [Me] function

To filter content in SharePoint libraries and lists so that users only see items that they created or modified use the [Me] filter. The filter will only work with SharePoint user IDs for example Created By / Modified By. It won't work with custom created fields like User Name unless it is associated with a SharePoint ID. (See Greg Collins blog post "Use the SharePoint '[Me]' Filter with a Promoted Property", for other functions see WSS FAQ)

Monday, June 02, 2008

My Site Horizontal Navigation

To add tabs for specific users to their My Site:
  • Open Shared Services and navigate to Personalisation Site Links
  • Add a new item providing URL, Owner & Target Audience
  • Click Ok
  • Refresh My Site and you should see the new link in between the My Home and the My Profile tabs