tags:

views:

146

answers:

1

I am getting an error when I call SPFieldCollection.AddFieldAsXml().

Why is that? Here is the string I'm using:

"<Field Type='Note' Required='FALSE' NumLines='6' RichText='FALSE' Sortable='FALSE' ID='{aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa}' StaticName='tempField' Name='tempField' />"

Naturally, I'm using a different guid.

EDIT: MOSS2007/WSS3.0 EDIT2: Rephrased as question.

+1  A: 

I forgot the DisplayName attribute. The following works:

"<Field Type='Note' Required='FALSE' NumLines='6' RichText='FALSE' Sortable='FALSE' ID='{aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa}' DisplayName='tempField' StaticName='tempField' Name='tempField' />"

Chloraphil