How to Remove Workspace Link from a Calendar

April 26 2010 10 comments

This one has been discussed in a few articles in the internet. One way to hide workspace link from calendar is to do it with JavaScript, the other way is to modify calendar schema, and of course there are several other methods to do it. All of these seemed like a hacks, so I wanted to try to do it differently, and here is our solution with simple feature receiver.

First, we need to provision a new calendar with our custom Feature:

<?xml version="1.0" encoding="utf-8" ?>
<Feature
    Id="AF8444FE-65D9-4ae2-BAD7-C39917871474"
    Title="Calendar without Workspace Link"
    Description="Installs a new calendar without workspace link."
    Version="1.0.0.0"
    Scope="Web"
    Hidden="FALSE"
    ImageUrl="Meteoriitti/Feature.gif"
    ReceiverAssembly="..."
    ReceiverClass="CalendarFeatureReceiver"
    xmlns="http://schemas.microsoft.com/sharepoint/">
    <ElementManifests>
        <ElementManifest Location="Lists.xml"/>
    </ElementManifests>
</Feature>

Lists.xml:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <ListInstance
        Title="Events"
        Description="Event calendar..."
        Url="Lists/Events"
        TemplateType="106"
        OnQuickLaunch="True"
        FeatureId="00BFEA71-EC85-4903-972D-EBE475780106">
    </ListInstance>
</Elements>

And the most important part of it, the Feature Receiver:

public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
    var web = properties.Feature.Parent as SPWeb;
    if (web == null) return;
    using (web)
    {
        var list = web.Lists["Events"];
        var field = list.Fields[SPBuiltInFieldId.WorkspaceLink];
        field.Hidden = true;
        field.Update();
    }
}

You can use the code for example in a PowerShell too, if you need to modify existing calendar. It seems like you can edit sealed content types’ fields’ Hidden property without errors. I also tried deletion, but it didn’t work. ShowInNewForm property didn’t have any effect either. Finally the Hidden property worked just fine.

This seem rather obvious now, :-) .

Popularity: 2% [?]

10 comments to “How to Remove Workspace Link from a Calendar”

  1. Edge says:

    well done! another very clever solution to ‘ skin a cat’ :)

  2. adp says:

    brilliant!

  3. [...] SharePoint Blues I discovered that if you set the calendar list field to hidden then this option would no longer display. Taking this concept, I created a PowerShell script to set [...]

  4. Richard says:

    Great post, I took this concept and turned it into a PowerShell script to make the column hidden.
    http://blog.salamandersoft.co.uk/index.php/2011/03/using-powershell-to-remove-the-use-a-meeting-workspace-option-from-sharepoint-calendars/

    Having then done that I realised that you could edit the Event content type to make it hidden across the entire site collection
    http://blog.salamandersoft.co.uk/index.php/2011/03/removing-the-use-a-meeting-workspace-option-from-all-existing-and-new-sharepoint-calendars-in-a-site-collection/

  5. This can be done using in gui using the free sharepoint designer 2010 without any powershell or java scripting !!

    using sharepoint designer 2010
    1) underneath lists an librarys : choose your list for which you want workspace to be hidden
    2) underneath content type : choose event
    3) choose modify coloms for content types
    4) select the workspace colom and click on Web Page Management
    5) in colom settings : choose hidden

    These is a translation from my dutch sharepoint designer, so maybe the english words are not exactly the same as in the english version of sharepoint designer, but this is the easy way to go
    If someone can replay this with an englisch sharepoint designer, please correct this article.

  6. I will immediately clutch your rss as I can’t in finding your email subscription hyperlink or e-newsletter service. Do you have any? Kindly let me understand so that I could subscribe. Thanks.

  7. Jess Wong says:

    Patriek Witdouck hit the nail on the head. No code or custom work of any sort is required, thank you!

    Here are the English steps in SP Designer:

    Using Sharepoint Designer 2010, open the site where your calendar is.
    1) Underneath Lists and Libraries : Choose your Calendar for which you want workspace to be hidden
    2) Underneath Content types : Choose Event
    3) In the menu under Content Type Settings tab: Choose Edit Columns
    4) Select the Workspace column and click on Administration Web Page in the menu
    5) in column settings : Choose Hidden

  8. Terrific paintings! This is the type of information that are meant to be shared around the net. Shame on the search engines for not positioning this put up upper! Come on over and consult with my web site . Thanks =)

  9. gel nail says:

    Excellent blog you have here but I was wanting to know
    if you knew of any user discussion forums that cover the same topics discussed here?

    I’d really like to be a part of online community where I can get opinions
    from other knowledgeable people that share the same interest.
    If you have any suggestions, please let me know. Thanks!

Leave a Reply