April 3, 2007

MOSS: Creating folders to list in ONET.XML

Problem:
One can easily create items to lists in ONET.XML, but how to create folders?

Solution:
Key is to use ContentTypeId and FSObjType.
<Row>
  <Field Name='ContentTypeId'>0x0120</Field>
  <Field Name='FSObjType'>1</Field>
  <Field Name='Title'>folder title</Field>
  <Field Name='LinkTitle'>folder title</Field>
</Row>

1 comments:

Anonymous said...

How do we create sub folders inside a folder in onet.xml?