SharePoint Blog - René Hézser

Anmelden  RSS Feed RSS Feed
Startet die Suche

Archive

Kategorien

Links

Andere Blogs




ITaCS GmbH

Aug 272011

StaticName != InternalName

Recently I was trying to fetch a SPField from a SPWeb object. I had SharePoint 2010, so I decided to use the new SPFieldCollection.TryGetFieldByStaticName() Method.

image

You can imagine how surprised I was, that I couldn’t get the field I was looking for. What do we learn? Well, the StaticName of an SPField is not necessarily the InternalName!

Here is a link to the MSDN about SPField.StaticName: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.staticname.aspx


Published: 8/27/2011  8:22 PM | 0  Comments | 0  Links to this post
Tagged as: SharePoint, Development, SPField

Mar 122009

Issues in WSS V2

Responses to items in an Issue list (SPListIssue) are new version in WSS V3. WSS V2 lacks the ability to use versions for lists. So what did Microsoft do that an Issue list behaves like it is using versions?

In WSS V2 items in a single “thread” all have different ItemIDs. To group them together, all have the same IssueID. This is the ItemID from the original item.

A single issue in WSS V2 could look like this:

image 

In WSS V3 it should look like this:

 image

But how can we move/copy the item from V2 to V3? How is the data stored in the old SharePoint?

WSS V2   WSS v3
ItemID IssueID Data entered Data stored   ItemID Version Data stored
1 1 A A+B+C+D   1 4 D
2 1 B A   1 3 C
3 1 C A+B   1 2 B
4 1 D A+B+C   1 1 A

Versioning in WSS V3

Each new version stores the data, which was entered for that particular version. SharePoint will merge the data from the current version with all previous versions.

Versioning in WSS V2

There was no versioning for lists in WSS V2. So Microsoft decided to add new items for a version, and map versions by an IssueID. The problem is, that they did not aggregate the data entered like they do in WSS V3.

The data entered was “A”. Later it was changed to “B”, “C” and finally “D”. WSS V3 stores the data in the same order as it was entered, and aggregates it for displaying. WSS V2 cycles the data, so it will show for each version the data aggregated from all previous versions. Only the current item (the one which was the first item for the issue) shows the newest data.


Published: 3/12/2009  7:44 PM | 0  Comments | 0  Links to this post
Tagged as: Development, SharePoint, SPField

Jan 022009

SPQuery, ViewFields and empty fields

If you want your query to return empty columns, you have to add Nullable='TRUE' to the viewfields.

<FieldRef Name='Field1' Nullable='TRUE'/>

If you do not add the Nullable attribute, accessing the results of the query like this:

oListItemAvailable["Field1"] will give an Exception.

I’ve made posted a comment about this on the page in the MSDN http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spquery.viewfields.aspx


Published: 1/2/2009  10:55 AM | 0  Comments | 0  Links to this post
Tagged as: Development, SharePoint, SPField, SPQuery

Dec 032008

Supported field types as source for Lookup Fields

Lookup fields are great. They can show information from other lists. I have never noticed before, that the only two supported field types for lookups are SPFieldText and SPFieldCalculated.

All other field types can not be used as source for lookup fields.


Published: 12/3/2008  2:00 PM | 0  Comments | 0  Links to this post
Tagged as: Development, SharePoint, SPField