Geeks With Blogs
Tangible Thoughts SharePoint, MOSS? and all the other questions

Creating and using Calculated Columns in your ContentTypes are a bit tricky.

First off the syntax for defining a Calculated column is like

<Field ID="{Some GUID}" Name="Name" Group="GroupName" Type="Calculated" DisplayName="Display Name" StaticName="Name" FromBaseType="TRUE" ResultType="Number/Text" ReadOnly="TRUE">
    <Formula>Some Forumula</Formula>
        <FieldRefs>
            <FieldRef Name="Name of Field Referred"/>
        </FieldRefs>
</Field>

For the calculated column to work in multiple ContentTypes each of the fields referred in calculation should be a part of the ContentType and ...

<the most vital part as it caused me a lot of pain yesterday and took a while to figure out >

... the referred columns should have the same Display Name in the ContentType as when Columns were originally defined. That is you cant use a column referred in a ContentType and change its Display Name within the ContentType.

 

tags: , , ,

Cross-posted from tariqayad.com

Posted on Tuesday, September 19, 2006 9:25 PM SharePoint | Back to top


Comments on this post: Calculated Columns in ContentTypes

# re: Calculated Columns in ContentTypes
Requesting Gravatar...
Apparently FromBaseType and Required attributes are important, because until I added these, I kept getting "Could not complete this action" when trying to add my content type which contained calculated columns to my document library.
Left by .NET Coder on May 11, 2009 9:54 AM

# re: Calculated Columns in ContentTypes
Requesting Gravatar...
Are you sure about that ?
Left by gamble on Dec 16, 2011 4:49 PM

Your comment:
 (will show your gravatar)


Copyright © Tariq | Powered by: GeeksWithBlogs.net