How to quickly get the solution id from wsp file

Finding the solution id from a wsp is quite difficult if you do not have access to the manifest.xml used to create it. I’m using SharePoint installer to install wsp files to client environments, as they think it is a lot safer, than batch files or typing in stsadm commands.

There’s one wsp that I needed to package using SharePoint installer but does not have the source code for it, SharePoint installer requires the solution id. But I don’t have the source code anymore.

In this case a quick and easy way was to login to your development server and deploy your solution package if its not there yet. Then run this stsadm command:

stsadm -o enumsolutions > C:\Temp\solutions.txt

This will list all solutions that is added on your farm, just look for the name of your solution and underneath it is the solution ID.

Popularity: 3%

Missing audience targeting on web parts

Audience targeting is a nice feature available in SharePoint Server to allow an administrator to hide and show webparts based on user permissions. A web part can be targeted to certain groups and be hidden for others. If you’re using SharePoint Server and the audience targetting box is missing when you edit a web part. You need to check the following.

1. If you’re using a list web part, for example, a document library web part, make sure that Audience Targetting is enabled on that list. You can go to list settings and click audience targetting.

2. Make sure that you properly configured Shared Services Provider on your Central Administration Site, otherwise it will not be shown.

NOTE: This is only applicable for SharePoint Server 2007, audience targeting for web parts are not available in WSS.

Popularity: 3%

Change SharePoint Log directory

Whenever my system drive reports that there is no space left, my usual suspect is the SharePoint trace log, it is located under the 12 hive folder at LOGS. Clearing this folder up usually frees up a couple of gigabytes but it’s not uncommon to have hundreds of gigs worth of logs on your system drive. Since this folder continually grows, it is a good idea to store it somewhere else, in a different drive or partition.

Below are the steps to change the default SharePoint log directory:

  1. Login to Central Administration site
  2. Go to Operations tab, and click on Diagnostic Logging.
  3. Scroll down the page, under the Trace Log section.

You may also change the number of logs to be kept and how long does each file will be used. Make sure that you have enough space as this folder will keep on growing.

Popularity: 3%

A new way of retrieving lists in SharePoint 2010

Just found of a new method within the SPListCollection object that season WSS 3.0 devs will appreciate a lot. In WSS 3.0, there’s not really a neat way to get an instance of a list that might not exist.

I usually use SPList myList = web.Lists[listName]; but it throws a null reference error if the list is not there. Looping through the SPListItemCollection object is usually how we’ll check for a list instance, but I think its a waste of resources.

In SharePoint 2010, a new method “TryGetList” is implemented to get the list and it throws a null refernce if it doesn’t find it.

using (SPWeb web = site.RootWeb)
{
 SPList myList = web.Lists.TryGetList("My List Name");
 if (myList != null)
 {
  ...
 }
}

I’m excited to get my hands dirty in SP2010, I hope incoming projects will be based on it.

Popularity: 5%

SharePoint update Created By and Modified By

I just turned a new leaf in my SharePoint career and now officially in my 7th SharePoint project. This is my second major project doing a migration from a different platform to SharePoint.

A few years back, I was doing a migration from a java based content management system into SharePoint. One of the issues raised during our user acceptance test was the Created By and Modified By values in SharePoint for pages that has been migrated are always “System Account”. When i try to modify it through the object model, I just received an error saying “Invalid data, updating read only fields”, so I gave up.

The tool that we are using for migration have the capability to do just that, and I was curious how they did it, so I did my research again, and found what I’ve done wrong in the past. Continue reading

Popularity: 7%

SharePoint page title turns blank

If your SharePoint page turns blank after an ajax request, look no further.
Below is how you can fix it on your SharePoint deployment.

This issue is encountered if you are doing any asynchronous (ajax) request on your SharePoint page, and it appears that this issue does not affect all site templates but only publishing sites.

The fix is very simple, you just need to modify how SharePoint renders the title tag. Unfortunately the default masterpages in SharePoint look like this:

<title id=”onetidTitle”>
<asp:ContentPlaceHolder id=”PlaceHolderPageTitle” runat=”server”/>
</title>

And change it to this, make sure it is all contained within a single line.

<title id=”onetidTitle”><asp:ContentPlaceHolder id=”PlaceHolderPageTitle” runat=”server”/></title>

Deploy the masterpage, and that should be enough to fix this issue.

Popularity: 6%

Planning for SharePoint 2010 – MOSS 2007 solution

I’m about to begin with a new SharePoint project and the management decided for it to be based on MOSS 2007. Basically its a baseline moss based portal, where future projects will be based on. And one of the critical requirements is it should support migration to SharePoint 2010 effortlessly.

Continue reading

Popularity: 4%

SharePoint 2010 – Projected Fields

SharePoint 2010 Projected Fields Projected fields are one of the new things SharePoint developers can use in their disposal with the improved list relationships and joins in SharePoint 2010. With projected fields, we don’t need to put several lookup fields from the parent list, in its basic sense, we just need to define one lookup field from the child list, and through the projected fields, we can display other fields from the child list.

Projected fields are read-only, and the most common use for it is by including extra fields from parent list to the view of child list.

Popularity: 13%

Creating Post Synchronous Event Receivers

With SharePoint 2010, “after” events or those ending with -ed such as ItemAdded, ItemDeleted, are exlusively asynchronous events. Most of the time, these would be fine and in case we needed the event to be synchoronous, then we use the -ing events such as ItemAdding or ItemDeleting. But what if we want to do some cleanup after the event has been completed? A scenario that came up to my mind is if we want to redirect the user to another page after a new item has been added or deleted to a list.
Post Synchronous events are now supported with the addition of the “Synchronization” property in the SPEventReceiverDefinition class.
SPEventReceiverDefinition myReceiver = eventReceivers.Add();
myReceiver.Synchronization = SPEventReceiverSynchronization.Sychronous;

Popularity: 11%

SharePoint 2010 – Demo VM ready for download

Microsoft has released the RTM version of its virtual machine images for evaluation environment. It contains two VHDs with pre-configured Windows Server 2008 R2 and SharePoint 2010, together with other software.

These virtual machines are Hyper-V images, so it requires your host OS to be Windows 2008 Server  R2 with the Hyper-V role enabled. In my case, I’m running Windows 7 as my host OS, so I convert the images to VMware Workstation images using WinImage Tool.

Continue reading

Popularity: 7%