CAML Cheat Sheet

Fields (Site Columns)

Integer

Text

<Field ID="{E4A8F331-3633-49BE-9BAA-8E5B75787AB5}" Name="TextField"DisplayName="Text Field" StaticName="TextField"
Type="Text" />
<Field ID="{e4a8f331-3633-49be-9baa-8e5b75787ab5}" Name="TextField"DisplayName="Text Field" StaticName="TextField" Type="Text" MaxLength="255" 
> 
  <DefaultFormula>=This is the default text</DefaultFormula>
</Field>

Note

DateTime

Counter

Choice

<Field ID="{4F9829C3-205D-4A13-BAAA-5CC1DD79961B}" Name="ChoiceField" DisplayName="Choice Field" StaticName="ChoiceField" 
Type="Choice" BaseType="Text" 
>
  <Default>Choice 1</Default>
  <CHOICES>
    <CHOICE>Choice 1</CHOICE>
    <CHOICE>Choice 2</CHOICE>
    <CHOICE>Choice 3</CHOICE>
    <CHOICE>Choice 4</CHOICE>
  </CHOICES>
</Field>

Lookup

Boolean

Number

SourceID="MyProjectName" Group="MyProjectName" 
 >
 50

 .50

Currency

URL

Compute

Threading

Guid

MultiChoice

GridChoice

Calculated

File

Attachments

User

UserSelectionScope="0" UserSelectionMode="0" ShowField="ImnName" List="UserInfo"
>
UserSelectionScope
UserSelectionMode

Recurrence

CrossProjectLink

ModStat

Error

ContentTypeId

PageSeparator

ThreadIndex

WorkflowStatus

AllDayEvent

WorkflowEventType

MaxItems

Common Attributes

Required="FALSE"
Version="1"
EnforceUniqueValues: (TRUE/FALSE)
SourceID
Group

TaxonomyPicker Error on Event Logs

I always see this error on the logs. Though harmless it’s also useless.

TaxonomyPicker Error on Windows Event Logs

TaxonomyPicker Error on Windows Event Logs

To stop seeing this error just rename the TaxonomyPicker.ascx to something else.

cd "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES"
ren TaxonomyPicker.ascx TaxonomyPicker.ascx_useless

How to Find a Feature using GUID

Suppose you’re creating a site and encountered an error like this.

You want to know what feature it is missing by using the GUID. Here’s how using PowerShell.

Get-SPFeature -Identity enter_guid_without_braces.

 Get-SPFeature -Identity d5191a77-fa2d-4801-9baf-9f4205c9e9d2

And if you want just a list of all features run the command without parameters.

Get-SPFeature

InfoPath Logging Stsadm Commands

I sometimes need to change the diagnostic logging levels temporarily to debug InfoPath Web Forms.  I’ve created this  batch commands you help you do that quickly.  These commands I’ve used on MOSS.

Save how the current diagnostic levels are set on your server

You should do this before you begin.

stsadm -o listlogginglevels

Set the trace levels to verbose

stsadm -o setlogginglevel -category "Forms Services Administration" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services Conversion and Deployment" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services Data Binding" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services Data Objects" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services Deployment" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services File Open" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services Object Model" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services Rendering" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services Runtime" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services Runtime - Business Logic" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services Runtime - Data Connections" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services Runtime - Session State" -tracelevel verbose
stsadm -o setlogginglevel -category "Forms Services Validation" -tracelevel verbose

Set the trace levels to medium (normal setting)

stsadm -o setlogginglevel -category "Forms Services Administration" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services Conversion and Deployment" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services Data Binding" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services Data Objects" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services Deployment" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services File Open" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services Object Model" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services Rendering" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services Runtime" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services Runtime - Business Logic" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services Runtime - Data Connections" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services Runtime - Session State" -tracelevel medium
stsadm -o setlogginglevel -category "Forms Services Validation" -tracelevel medium

The commands only change the trace levels.  I’m using a tool to monitor trace logs called ulsviewer.

Using VMware Workstation to Run the 2010 Information Worker Virtual Machines

I’ve download the 2010 Information Worker Demonstration and Evaluation Virtual Machine (RTM) but somehow I wanted run this using VMware Workstation.  Here’s some quick instructions on how to do this easily.

Applications Used:

  1. Create a new virtual machine based on Windows Server 2008 x64 Edition. You can remove the Sound Card and Floppy from your virtual machine settings. Also remove the Hard Disk.
  2. Convert the 2010-7a.vhd file to .vmdk file. Open WinImage and click on Disk -> Convert Virtual Disk image… Select  Create Fixed Size Virtual Hard Disk (Recommended. Make sure you have 130 GB of free space).   Save the file and don’t forget to change the Save as type: to VMWare VMDK (*.vmdk)
  3. Add the converted file to your virtual machine.

Now you’re ready to run the virtual machine for the first time.

If you don’t have VMware Workstation you can use VMware Player (free) and use easyvmx (again free) to create virtual machines for VMware Player.  You can check this blog for more detailed instructions.

Other things I’ve tried:
I also tried to convert the .vhd file to .vmdk file using StarWind V2V Image Converter v5.6 but I’m only getting a BSOD on both VMware Workstation 6.5.4 and VirtualBox 3.2.10.