Thursday, September 11, 2008

Display concatenated columns in Calendar view and customize pages for adding or editing list items

In this post, I am going to talk about two things:

- How to display more than one columns in SharePoint Calendar view

- How to customize ASPX pages/forms used for adding, editing or displaying list items using SharePoint Designer

So let’s start with how to display concatenated columns in Calendar view. Here is the simple Calendar Month view,

First requirement is, I want to add an additional column for organizer of the event and display title and time instead of just title in Calendar month view. I am going to add “Organizer” column to Calendar by creating a new column and selecting “People or Group” in column type so that I can select organizer of an event from AD users. Also it is set to display name of a person in organizer column.

As shown below, I can select organizer from AD users now,

My second requirement is to display more than one column in Calendar month view. I want to display “Title” and “Time” instead of just “Title”. So create a new column for the Calendar and select “Calculated (calculation based on other columns)” for column type. Next step is to define formula for this column. I have used following formula,

=Title&" | "&TEXT ([Start Time],"HH:MM AM/PM") &"-"&TEXT ([End Time],"HH:MM AM/PM")

Which will convert start time and end time to “Hours: Minutes AM/PM” string and then append it to “Title” of the event.

Finally I need to change column to display in month view of Calendar to “TitleAndTime” as shown below,

That’s it! You are done. Now you can see “Title” and “Time” in month view of Calendar.

Now, let’s see how we can customize ASPX pages (forms) to add, edit or display list items. I will walk you through the steps for customizing “NewForm.aspx” for adding a new event to a Calendar. To start with let’s open that SharePoint site in SharePoint Designer 2007. Once the SharePoint site is opened in SharePoint Designer, Go to the “Lists” and expand “Calendar”, Right click on “NewForm.aspx” and select “New From Existing Page” as shown below,

I would recommend you to save this page with different name at the same location - “Lists > Calendar”. So that “NewForm.aspx” page will remain intact and you will have an option to switch it back to original page in case you mess up this form while customizing it. So I am going to store it as “NewForm2.aspx”

Now we can start customizing “NewForm.aspx” page. The requirement is to keep only Title, Location, Start Time, End Time and Organizer columns and delete the rest. Here are the steps,

Select “PlaceHolderMain (Custom)” and click “Default to Master’s Content”,

Select “Yes” on the confirmation window,

“NewForm2.aspx” will look like this after following above steps,

With “PlaceHolderMain (Custom)” selected, Select “Insert” menu on the top and select “SharePoint Controls > Custom List Form…” as shown below,

Select “Calendar” in list and “Event” in content type. Also, select “New item form (used to add new items to the list)” in type of form to create,

“NewForm2.aspx” form will look like this after following above steps,

Now, we want to select all unwanted columns from this page – “NewForm2.aspx”. Select rows for Description, All Day Event, Recurrence and Workspace fields; Right click it and select Delete > Delete Rows to delete all these rows,

Here is how “NewForm2.aspx” looks like after customizing it as per above requirements,

Finally we want to set this page – “NewForm2.aspx” as default form when somebody adds a new event item to the Calendar. In order to do that, Right click on “Calendar” and select “Properties”,

Select “Supporting Files” tab and change new item form to “NewForm2.aspx” page with the help of “Browse” button,

Save all your changes and you are done!

Go to the Calendar of a SharePoint site and click “New” button to add a new event. You will have “NewForm2.aspx” page opened for adding new items,

Similarly you can customize pages/forms used for editing or displaying list items.

Wednesday, August 20, 2008

Unable to open SharePoint e-mail alerts in MS Outlook 2007

As shown below, SharePoint alert will not open in MS Outlook 2007 if you have MS Exchange Server 2003 in your organization and it is not upgraded to service pack 2 with the hot fix for this issue.

Note: You will not be able to open or view SharePoint alert directly but you can click “Reply” button and see the alert message in reply window.

SharePoint alerts will not open in MS Outlook 2007 however you will be able to open them in Outlook Web Access – OWA,

Following screen captures show work around for this issue however it is not recommended by Exchange experts. Please contact Exchange Server administrator in your organization before you apply this work around for your MS Outlook 2007.

1. Click Start > Settings > Control Panel > Mail

2. On the Mail Setup - Outlook window, click “Data Files”

3. On the Account Settings window, select “Data Files” tab, highlight your email account if you see more than one email accounts and then click “Settings”

4. On the Microsoft Exchange window, select “Advanced” tab and uncheck "Use Cached Exchange Mode" checkbox.

5. Click “Apply” and “OK”.

6. If it prompts for "You must restart Outlook for these changes to take effect“, click “OK” and restart MS Outlook 2007.

You should be able to open and view SharePoint email alerts in MS Outlook 2007 after following above steps,

Caveats:

After you turn off "Cached Exchange Mode", you will notice a slow down as you will be accessing your mail directly on the Exchange server rather than a locally cached copy.

In many companies there are upwards of several hundred mega bytes of e-mail on Exchange Server. You'll waste hours and tons of bandwidth for re-syncing your mailbox. If you are a laptop or remote user DO NOT USE THIS WORK AROUND; if you are using hosted Exchange service DO NOT DO THIS.

Recommendation:

Install MS Exchange Server 2003 Service Pack 2 and then apply hot fix for this issue (KB 930807) or Click “Reply” and you will see the message in the contents of the reply window. That's a lot easier and less disruptive than turning off "Cached Exchange Mode" for MS Outlook 2007.

Microsoft KB article and hot fix information:

http://support.microsoft.com/kb/930807

Thanks to Kathy Hughes for posting this information in her blog.

Tuesday, August 19, 2008

What happens when you enable “Publishing” feature of your top level team site?

You may want to enable “Publishing” feature for customizing SharePoint sites, creating and publishing your own custom master pages, having “All Sites” search scope available at site collection level etc.

Let’s take a look how Site Actions > Site Settings menu looks like without enabling “Office SharePoint Server Publishing Infrastructure” for your top level team site. Here is the screen capture,

Note that you will see “Top link bar” for managing navigation links for your site,

I have created another two sub sites under this top level site – Test Site Collection (sites/TestSC) and you can see three tabs on the top. “Home” tab for top level site, “Site1” tab for sub site – sites/TestSC/Site1 and “Site2” tab for another sub site – sites/TestSC/Site2 as shown below. It will add these tabs on top automatically as you create them.

Now, let’s enable “Publishing” feature – “Office SharePoint Server Publishing Infrastructure” for Test Site Collection,

You will also need to enable it from Site Actions > Site Settings > Site Features – “Office SharePoint Server Publishing”.

After enabling “Publishing” feature for Test Site Collection, here is how Site Actions > Site Settings menu looks like,

Note that “Top link bar” link is no more available and it has been replaced with “Navigation” link. Also note that “Home” tab has been replaced with the actual name of the top level site – “Test Site Collection”,

Next few screen captures are very important to avoid issues when you turn on and turn off publishing feature for your team site.

If you go to Site Actions > Site Settings > Navigation and delete tabs for sub sites and then you turn off publishing feature for your team site from “Site features” and “Site collection features” then it will create tabs for all the sub sites on the top but it will NOT restore “Home” tab. Let’s try to produce this error. So I am going to delete tabs for all the sub sites under the top level site – “Test Site Collection”,

So I have only one tab on the top, which is “Test Site Collection” – for top level site itself and I would expect to have this tab as “Home” when I turn of publishing feature for this site,

Here is what happens, when I turn off publishing feature for Test Site Collection. “Home” tab is missing and a tab will be created for each sub site under this top level site,

You can definitely add “Home” tab by going to “Top link bar” but it will NOT be highlighted even though you are on top level site – “Test Site Collection”,

As shown below, “Site1” tab is highlighted even though I am browsing top level site – “Test Site Collection”, which is pretty misleading.

Following step is to connect top level site to the portal. This is to show a link to a portal site on the top. Note that the “SharePoint Global Portal > Test Site Collection” link is added on the top. (Note: This has nothing to do with the issues occur when you turn on and turn off publishing features).

If you turn on the publishing feature for your team site again then it will be alright with showing “Test Site Collection”, “Site1” and “Site2” tabs on the top but for some reasons, when you turn off publishing feature it will not result in “Home”, “Site1” and “Site2” tabs on the top, the way it was before, when we created the top level site for the first time (you can take a look from previous screen captures).

Conclusion: If you want to enable publishing feature for your top level team site and you also want to remove tabs for sub sites from the top, remove them before activating publishing feature. If you will remove tabs for sub sites after activating publishing feature and then turn off publishing feature, it will not restore “Home” tab for the top level site.

Friday, August 15, 2008

“The page cannot be found” error, when you click “Reply” in Subject view of Discussion Board in SharePoint 2007.

Here is the scenario:

Subject view of Discussion Board in SharePoint 2007 does not have “Reply” column available in default view settings. Here is the example of a new Discussion Board created for one of the SharePoint sites,

Let’s add “Reply” column by going to Discussion Board settings.

This will make “Reply” column visible with “Reply” button for each topic in Discussion Board.

Now, when you click on “Reply” button to reply to any of the topics, you will receive an "HTTP 400" error message – “The page cannot be found” error.

The only way to reply to a topic is by clicking on a topic under the “Subject” column and then hit the “Reply” button.

Yes, somebody can reply to a topic this way.

Here is the KB Article from Microsoft to show you the work around on how to reply a topic in Discussion Board,

KB Title: Error message when you click Reply in a Windows SharePoint Services 3.0 discussion board in Subject view: "The page cannot be found"

http://support.microsoft.com/kb/936859

Looks like, this issue has been addressed in WSS 3.0 Service Pack 1. Here is the Microsoft KB Article,

Note: Unfortunately we haven't installed Service Pack 1 in our SharePoint (MOSS 2007) environment yet to confirm this.

KB Title: Issues that are fixed in Windows SharePoint Services 3.0 by Windows SharePoint Services 3.0 Service Pack 1

http://support.microsoft.com/kb/942388

When you reply to a discussion in the Subject view of a discussion board, you receive an "HTTP 400" error message

Consider the following scenario. The Subject view of a discussion board contains the Reply column. You click Reply in the Subject view. In this scenario, you receive an "HTTP 400" error message – “The page cannot be found”.

Thursday, August 7, 2008

How to create dedicated content database for a site collection:

Steps to create a new site collection in a new content database:

Let’s assume that I want to create a new dedicated content database for a new site collection. This site collection will have huge contents and it may require database of size 60-80 GB. Also we do not want any of the content databases to grow more than 100 GB (Microsoft recommended content database size). So we decided to create a new dedicated content database for this site collection. Any new site collection after this must be created in a content database with a least number of sites in it, provided it is not crossing the limit of maximum allowed sites in that content database.

As usual, I have taken few screen captures for better understanding of this scenario.

We have total 8 content databases for our MOSS 2007 deployment. I have created a new content database with the name “New_Content_DB”.

I want to create a new site collection in this new content database – “New_Content_DB” and then lock it. So that any new site collection after this will be created in a content database (any one from SPS01 to SPS08) with least number of sites in it. Let’s create a new site collection,

New site collection – “sites/newsc” was created in “New_Content_DB” as expected. Now, I would like to lock it so this content database will be used only for this site collection – “sites/newsc”.

I ran following query to confirm that the site collection – “sites/newsc” was created in “New_Content_DB” database.

Now, let’s lock it. I have set “Site Level Warning” to 0 and “Maximum Number of Sites” to 1 for this. Here is the screen capture,

Any new site collection after this must be created in content database with least number of sites in it. In our case it is SPS07. So let’s create a second site collection and it must be created in SPS07 instead of New_Content_DB. Here is the screen capture,

As shown below, the second site collection – “sites/newsc2” was created in SPS07 database.

One more time, SQL query to confirm that second site collection – “sites/newsc2” was created in SPS07 database.

Any new site collection after this point will be created in SPS07 and then SPS08 and so on…Here is the screen capture after creating couple of other site collections – “sites/newsc3”, “sites/newsc4” etc.

As per Microsoft recommendation SharePoint content database should not grow more than 100 GB in size. So you may want to move site collections with maximum contents or fastest growth from one content database to another (the smallest content database in your SharePoint farm or a new content database). Here are the few support links which can help you achieving this.

For SharePoint 2007:

First Release of the Microsoft SharePoint Administration Toolkit:
http://blogs.msdn.com/sharepoint/archive/2008/04/30/announcing-the-first-release-of-the-microsoft-sharepoint-administration-toolkit.aspx

Mergecontentdbs: Stsadm operation:
http://technet.microsoft.com/en-us/library/cc288557.aspx

One of the best posts for moving site collections to another content database:
http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?List=56f96349-3bb6-4087-94f4-7f95ff4ca81f&ID=53

For SharePoint 2003:

MS IT Database Split for WSS2.0 and SPS2003:
http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=governance&ReleaseId=5351