WSS – Rich Text column in Document Library

28 05 2009

I came across this issue the other day, you cannot add a rich text column to a document library, this was frustrating as I wanted to use the column to hold multiple html hyperlinks.

After doing some research I found this post on SharePoint Blogs –

http://www.sharepointblogs.com/forums/t/16166.aspx

It is possible to use a rich text column in a doc library but it must be done using a content type, I’ve written some instructions below on to get a document library setup with a rich text column:

  1. Configure ‘Advanced Settings’ for the document library and enable the management of content types.
  2. Create a new Site Column as multiline rich text.
  3. Create a new Content Type and add the column created in step 2.
  4. Add the Content Type to the document library using the ‘Add from existing site content types’ link.
  5. Save the document library as a template and delete the document library.
  6. Create the document library again using the template from step 5.
  7. Success! You should now be able to use a rich text column within a document library.

Hope this helps some people! 🙂

Advertisements




Bug in MOSS Service Pack 2

26 05 2009

For those of you who are not yet aware, Microsoft have discovered a bug in Service Pack 2 for MOSS. Once service pack 2 is installed, it resets the license of SharePoint server to the 180 day trial license. This means that if not remedied, the license could expire and access to the environment would be blocked.

The official blog post by the MOSS team is here –

http://blogs.msdn.com/sharepoint/archive/2009/05/21/attention-important-information-on-service-pack-2.aspx

The problem can be fixed by re-entering the license key (in the ‘Convert License Type’ page of Central Administration) or waiting for a hotfix which should be posted on the Microsoft support site sometime soon.

Hope this helps!





SharePoint Event Handlers – Getting item properties in the ItemAdded event

15 05 2009

As some of you may know, it is a real pain to try and get hold of an item’s properties in the ItemAdding or ItemAdded event, there are various blog posts describing the problems and possible solutions.

The one blog post that stands out for me is this one by Randy Williams –

http://www.synergyonline.com/blog/blog-moss/Lists/Posts/Post.aspx?ID=25

It seems if you are using a List rather than a document library then you can use the AfterProperties[“Fieldname”] to get the value in both the ItemAdded/ItemAdding events.

With a document library however, it seems to be a different story – both the ListItem.Properties and AfterProperties collections return no value when queried with the fieldname e.g. AfterProperties[“My Field Name”]. I have even tried using the internal field name – “My_x0020_Field_x0020_Name” but this also returns a null reference exception.

Well today, I have had a bit of a breakthrough – rather than reading the value directly from the properties.ListItem or properties.AfterProperties you need to first create a new SPListItem and then read the value from that. See my previous and now working code below:

Previous (Non-Working) Code:

(if properties.ListItem[“My Field”] != null)

{

string mystring = properties.ListItem[“My Field”].ToString();

}

The above code would always return a null reference exception when it first checked for the properties.ListItem[“My Field”] not being null.

Working Code:

SPListItem item = properties.ListItem;

(if item[“My Field”] != null)

{

string mystring = item[“My Field”].ToString();

}

I can only imagine that creating a new SPListItem and querying that retrieves all the values after the item has been added to the database – I am not really sure! All I can say is that it works well so I am going to use this method on all future event handlers.

Hope this helps someone! 🙂





SharePoint Event ID 3351 – Login failed for user ‘NT Authority/Anonymous Logon’

13 05 2009

I have noticed the above error keeps popping up in the Application event log of our SharePoint server so I decided to track down the problem. Initially I thought it might be application pool based but it turns out it is the ‘Microsoft SharePoint Services VSS Writer’ service that is causing the problem.

I found the solution over at the TechNet forums –

http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/7efeefce-129e-4a03-9ff7-900d6168952b

It seems the solution is to change the identity for the service to run under the SharePoint Active Directory  farm account rather ‘local system’ which is the default.

After you change the identity, restart the service and the error should no longer keep bothering you.

Hope this helps someone! 🙂





Windows 7 RC

7 05 2009

windows-7-logo Just thought id write a quick post about the recently released Windows 7 Release Candidate (Build 7100). I am now running this as my main OS and must say I am pretty impressed. Microsoft seem to have channeled all their effort into fixing Vista’s flaws and providing a stable base similar to Windows XP.

Boot up/load time of the OS is incredible, vista would take a good few minutes to load all my applications and be booted up ready for use. In contrast Windows 7 can go from login screen to fully loaded in under 30 seconds. I have been using 7 for about a week now and have not managed to make it crash or blue screen once so it seems strong in the reliability stakes.

The interface of 7 is very similar to vista except for the modification of the task bar to display the icons of the currently loaded apps rather than the icon and the text. This means you can fit a lot more onto the taskbar, its a bit odd at first but fine when you get used to it.

A new addition in windows 7 is ‘Virtual XP Mode’, this is a downloadable add-on from http://www.microsoft.com/windows/virtual-pc/ that is basically a glorified virtual machine. It allows you to run any application inside of a windows XP environment, great for those who don’t want to move to 7 because of compatibility issues.

All in all I am very impressed and certainly won’t be going back to vista! The RC is currently available for download from the MS site:

http://www.microsoft.com/windows/windows-7/download.aspx

Once registered you can also download a serial key. The RC build expires in 2010, plenty of time as 7 should be released by then. 🙂