Geeks With Blogs

Tangible Thoughts SharePoint, MOSS? and all the other questions

Been wanting to post this for sometime, just didn’t have the time to do it.

Ever looked closely at formulae in calculated fields?

I never realized how similar formulae in calculated fields were to CAML. It’s almost a 1:1 translation.

For example look at this

Calculated Field:

=AND(Category="Books",OR([Importance]="Critical",[Importance]="Urgent"))

CAML:

<And>

<Eq>

            <FieldRef Name=”Category”/>

            <Value Type=”Text”>Books></Value>

</Eq>

<Or>

            <Eq>

                        <FieldRef Name=”Importance”/>

                        <Value Type=”Text”/>Critical</Value

            </Eq>

            <Eq>

                        <FieldRef Name=”Importance”/>

                        <Value Type=”Text”/>Urgent</Value

            </Eq>

</Or>   

</And>

Both those are virtually the same, which leads me to assume that calculated fields are converted to CAML internally; but that’s not the important bit. The important bit is, naturally there should be something in the API similar to a parser that would convert ‘Calculated field’ formulae to CAML. In fact it might be much more usable than something I wrote.

I’m hunting for this now. Let me know if any of you find it.

 

Posted on Monday, February 7, 2005 9:20 AM SharePoint | Back to top


Comments on this post: OMG - Have I been blind all this while?

# re: OMG - Have I been blind all this while?
Requesting Gravatar...
Or maybe CAML is converted to calculated fields? They might just have reused some Excel logic in the backend and xml'ified the notation for CAML:-)
Left by Mads Nissen on Feb 07, 2005 9:59 AM

# re: OMG - Have I been blind all this while?
Requesting Gravatar...
Be careful what you post from now on. JeffJulian just pulled me... I no longer show up on the main page at all... :( Kinda immature if ya ask me.

C.
Left by Chris on Feb 07, 2005 3:46 PM

Your comment:
 (will show your gravatar)


Copyright © Tariq | Powered by: GeeksWithBlogs.net