Posts

Showing posts from May, 2011

Visual upgrade error in SharePoint 2010

I got following error when I made a visual upgrade:

"One or more field types are not installed properly." (in German: Mindestens ein Feld ist nicht richtig installiert. Wechseln Sie zur Listeneinstellungsseite, um diese Felder zu löschen.)
The error occurs due to a problem in the hidden relationshiplist. The entries are not updated properly. See Problems with visual upgrade.

The solution for this problem is easy: Install the newest Cumulatives Updates.

Most viewed documents in SharePoint 2010

Image
The Task You want to see the top 10 most viewed documents in a library

The Answer 1. Enable the two reporting features in your site collection features.


2. Go to the list and click on "Library Settings" in the ribbon



3. Click on "Information management policy settings" under "Permission and Management"


4. Click on document

5. Activate the checkbox "Enable Auditing" and select "Opening or downloading documents, viewing items in lists, or viewing item properties"


Now the auditing is enabled and each time when an item in the doclib is viewed a log entrie is generated. You can limit the size of the lib in the site collection settings under "Site collection audit settings" in the group "Site Collection Administration". Here you can specify that the log should be holded for a period of time.


6. Create a custom webpart or control. Here is the sample code to get the entries you want

using (SPSite site = new SPSite(mUrl)) …
I got the following error as I tried to run a console application to get data from SharePoint 2010:

the web application at ... could not be found. verify that you have typed the url correctly. if the url should be serving existing content, the system administrator may need to add a new request url mapping to the intended application.

The problem is that the default settings for a console project are .Net Framework 4 and Platform target X86. Change these settings to .Net Framework 3.5 and x64 and everthing will work fine.

jQuery and SharePoint 2010 conflict

When you try to use jQuery with SharePoint 2010 you could get problems in some browser like IE. This is caused because of conflicts with the Microsoft JavaScript selector "$", which is the same variable as the jQuery selector.

To avoid conflicts you can easily use the noConflictmethod of jQuery and change the selector for jQuery.

var $j = jQuery.noConflict(); $j(document).ready( function() { $j("#content").addClass("..."); });
For more information see jQuery.noConflict.