I was creating a custom list schema and I wanted to create a Datasheet view. I set the "Type" attribute on my "View" node to "GRID". However, when I tried to browse to the view, I got this error:
The list is displayed in Standard view. It cannot be displayed in Datasheet view for one or more of the following reasons: A datasheet component compatible with Windows SharePoint Services is not installed, your browser does not support ActiveX controls, or support for ActiveX controls is disabled.
All the information I found online seemed to talk about having Office 2003 components installed. I knew that this was not the issue I was having, because I could successfully browse to the Datasheet view for other lists on the site.

It turns out that I had a calculated field whose formula was throwing things off. I had created a column whose name didn't have spaces ("MyColumnName") but the display name did have spaces ("My Column Name"). When my formula referenced the field name without spaces (i.e. the Internal name) the Datasheet view worked.

The problem is that when I did that, the field in Standard view displayed that nice "#NAME?" value. The only way it would display the correct value is if I created the formula using the column with spaces (i.e. the Display Name).

My solution was this: I created the column with both an Internal and Display Name that don't use spaces, so the calculation formula would work. In the view itself, in the FieldRef node, I specified a display name (using the "DisplayName" attribute), so the field name would show up properly at the top of the column in the view.

Becky
06/19/08

My Posse

OK, so I don't normally post links to other blog entries, because I find it, well, redundant! But today I feel like I need to give a shout out to three of my talented SharePoint co-workers, who are all SharePoint Consultants for Microsoft Consulting Services in the North Central District. They're all like me, newbies to MCS, and are taking a stab at the whole blogging thing. Take a look at these recent articles:

Bryan Porter
Most recent article: ICallbackEventHandler

Matt Bremer
Most recent article: Why do Visual Studio Extensions for WSS 3.0 not support 64-Bit Platforms?

Eric Kraus
Most recent post: SharePoint Solution Packages "No More Xcopy"

Becky
06/17/08

The Crush of E-Mails

I listened to an interesting article on National Public Radio, called Make It Stop! Crushed by Too Many E-Mails, regarding the influx of e-mails we receive every day.

The quote that stood out to me was this:

At the same time, companies are seeking ways to make the technology itself better at filtering what matters from what doesn't. Yahoo, one of the biggest providers of Web-based mail, is trying to rethink its e-mail as a social network, according to John Kremer, vice president of Yahoo Mail. The idea is that since most of us e-mail only a handful of people regularly, e-mail systems should display those messages at the top of the inbox.

What we see increasingly in the arena of information management is a drive to intuitively filter information for users. I got my first home computer when I was 7 and the internet gained popularity when I was in college; that is to say, my generation lived through the start of the "information age." At first people were awed by the massive amounts of information that was available. As time went on, though, people started feeling "crushed by too many e-mails" (as the name of the NPR article indicates.)

I think about the simple act of searching for data. For years we have become accustomed to a Google-type search, in which we type in a word or phrase, and get a list of data back. In the "olden" days, we had to potentially click through 10 pages to get the info we needed. But now searching has become more sophisticated, granting alternative options for browsing (take a look at how you can search for images when you use Live Search), or providing a way to search not by keywords, but by concepts, like the company Fast, recently acquired by Microsoft. The idea of "tagging" content, and then putting "tag clouds" on a page, gives users a visual clue as to the popularity of that tag.

In terms of e-mail, the new company Xobni has gained quite a bit of press, because of the way that it helps users organize the information in their inboxes. The idea is that information is not relevant in and of itself, but its relevance is dictated largely upon who sent the e-mail. For instance, e-mails sent to me directly have more relevance to me than e-mails sent to a distribution list I'm on, and e-mails between my close co-workers might hold more relevance to me than e-mails from the building supervisor mentioning the cook-out in the parking lot that afternoon.

It will be interesting to see how various companies strive to filter data by intuiting what people want to see, as this trend marches forward. (I still don't think technology will ever be able to predict a women's mind, though. After all, women hold the right to change their mind at any given moment.)

I was tasked with creating a custom Event List (i.e. Calendar) to be deployed as a feature. I was confused, because even though I had successfully added the additional fields to the schema.xml file, they still weren't showing up when I tried to create a new event. I figured out that I needed to extended the base Event content type to include my new columns, if I wanted them to appear in the "new", "view", and "edit" screens. Here's how I went about building my feature:

Inside my list definition Feature, I created three element files. (Each file is an XML field that begins with the Elements element.) You could probably put them in one element file, but I prefer breaking it out so it's easier to differentiate what's in each file.

  • Fields.xml - Contains a list of the Field elements I want to add to the event.
  • ContentTypes.xml - Contains a ContentType element. The content type ID should start with 0x0102, followed by two "00"s, followed by a new GUID. You can read about base Content Type IDs here, and creating Content Type IDs based on other Content Types here. Add FieldRef elements to the content type the correspond to the Fields you added to your Field.xml file.
  • List.xml - Contains the ListTemplate element, the refers to the list schema.

The Feature.xml will refer to all three Element Manifest files in the order listed above.

So far, this simply creates the a new Event Content Type. To add it to the new list schema, you need to add it as a ContentTypeRef element in your schema.

To put it all together, here is some sample code:

Fields.xml

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Field ID="{14A2BF57-A9CA-43d9-8C92-68313B70C059}"
    Type="Text"
    Name="MyNewField"
    DisplayName="My New Field"
    StaticName="MyNewField"
    SourceID="http://schemas.microsoft.com/sharepoint/v3" />
</Elements>

ContentTypes.xml

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ContentType ID="0x010200C69A624AA53E459aBCD5D652B4447EFA" Name="MyCustomEvent">
    <FieldRefs>
      <FieldRef ID="{14A2BF57-A9CA-43d9-8C92-68313B70C059}" Name="MyNewField" />
    </FieldRefs>
  </ContentType>
</Elements>

List.xml

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListTemplate
    Name="MyNewCalendar"
    DisplayName="My New Calendar"
    BaseType="0"
    Type="8000"
    OnQuickLaunch="TRUE"
    Image="/_layouts/images/itevent.gif"
    SecurityBits="11"
    Sequence="350" />
</Elements>

Feature.xml
Element Manifest portion:

<ElementManifests>
  <ElementManifest Location="Fields.xml"/>
  <ElementManifest Location="ContentTypes.xml"/>
  <ElementManifest Location="List.xml" />
  <ElementFile Location="MyNewCalendar\schema.xml"/>
</ElementManifests>

schema.xml
The schema file is inside a folder called "MyNewCalendar" inside the Feature folder. (Note: it is important that the folder is named the same thing as the list name you specified in your ListTemplate element in your List.xml file, otherwise SharePoint will not be able to find the schema file and will throw an error when you try to create the list.)

<ContentTypes>
    <ContentTypeRef ID="0x010200C69A624AA53E459aBCD5D652B4447EFA" Name="MyCustomEvent">
    <Folder TargetName="Event" />
  </ContentTypeRef>
</ContentTypes>

Becky
06/05/08

Feature Dependency Order

I recently ran across a helpful blog entry by the Norwegian MCS Information Worker team, which succinctly outlines the relationships between features, in terms of activation dependencies across scopes and between hidden and visible features.

http://blogs.msdn.com/mcsnoiwb/archive/2008/05/28/hidden-features-and-dependencies.aspx

I've tried to visually represent some of the scenarios they've outlined:


This scenario does not work, because if you try activate the feature at the web level before the feature at the site level has been activated, it will throw an error in the UI saying you need to activate the feature at the site level, but there’s no way to do that via the UI because the site feature is hidden.


This scenario does not work, because a hidden feature cannot activate another hidden feature. (The List Definition feature could activate the Content Type feature, but the process would fail when the Content Type tried to activate the Columns feature.)


This process will work, as long as the Activation Dependency elements in the Feature definition are listed in the correct order. In this case, the List Definition feature would have an activation dependency on the hidden Content Type feature, and then the hidden Columns feature.


A better way to activate features might be like this: A single visible feature at the site level rolls up all hidden features that need to be activated at the site level. Another visible feature at the web level rolls up all the features that need to be activated at the web level. If the roll up feature at the web level has the site feature as its first dependency, because the roll up feature at the site level is visible, the user will get a meaningful message in the UI notifying them that they need to activate that feature. Once they do that, and they try to activate the roll up feature at the web level again, it will automatically activate the hidden features at the web level.

You can download a Visio document with these diagrams and explanations here.

1 2 3 4 5 >>

November 2008
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            

Search

powered by b2evolution