views:

324

answers:

2

Hi!

so I want to deploy a custom Content Type based on "Page" by Feature. The deployment of the Content Types works fine -- the custom Content Types is created based on "Page".

The thing that is missing are the FieldRefs: The Fields I reference in the FieldRefs Tag are not showing up in my deployed Content Type.

My Elements.xml looks like ...

<Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
<Field Type="Text"
DisplayName="PlantName"
Required="FALSE"
Group="Custom Columns"
ID="{2068B882-8349-4a7f-BA3A-60BE60DEFF9A}"
StaticName="PlantName"
Name="PlantName" />
<ContentType ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900A96BBF2C61EC4534A7654CEF00B72A9D"
Name="PlantDocument"
Group="Custom Content Types"
Description="PlantDocument"
Hidden="FALSE"
Version="0">
<FieldRefs>
<FieldRef ID="2068B882-8349-4a7f-BA3A-60BE60DEFF9A"
Name="PlantName" />
</FieldRefs>
</ContentType>
</Elements>

Can anyone tell me why "PlantName" is not present in my Content Type?

THANKS A LOT FOR ALL HELP!

A: 

I'm not sure if I've understood your issue totally but it sounds similar to something I've seen before.

I'm going to assume you've checked all the obvious things like your schema definition and wether you're deactivating and activating the your content type feature after deploying your schema..

Once you add a content type to your site, the likely scenario is that you create an instance of a page/list item based on that content type somewhere in your site. In my case it was two sub sites down. This worked fine for me. Once I updated my content type (by adding in a new field), although I could see the content type change spearing in the content type gallery but I couldn't see the change go through to the sub site where I had created a page based on my content type. This is because, when you create an instance of a item based on a certain content type, the sub site creates a cached copy of that content type in its current condition.

Later when you make changes to the content type, the cached copy in the subsite does NOT get updated. This isn't the most obvious thing in the world.

Maybe you cannot see the fields appearing in the sub site but they do exist in your site columns and the your root content type has been updated correctly.

If this is your issue then you need to perform, what we call a 'content-type push down'. To do this you can either download Gary Lapointe's stsadm command which you'll have to run through the command prompt (I hear this is risky in some scenarios). You can also do this manually but sorry, I can't remember exactly how this is done. You have to delete all instances based on your content type and try again. Quite a painful little task.

Zeb
A: 

I was having a similar problem, and after some experimentation I found that comments in the XML cause havoc.

This works fine

 <FieldRefs>
      <FieldRef ID="{4B9D42FA-8081-49AB-9F89-72FAB3C6609C}"/>
 </FieldRefs>

This does not work

<FieldRefs>
      <!-- My field comment -->
      <FieldRef ID="{4B9D42FA-8081-49AB-9F89-72FAB3C6609C}"/>
</FieldRefs>

I will refrain from commenting on this as I may get upset and stop working.

Joe Capka