0

I am using sp 2010. I have a list with for example contenttype "Project portal". I have add some new columns to this contenttype on website level. I can see these new columns on website content level. But I do not see them on the contenttype on list level. Why do they not inherited the new columns from the parent?

Here is the powershell script for the creation of the new columns:

$site = Get-SPSite -Identity "http://myCompany.net/teams/siterequests" 
$web = $site.RootWeb   
$ct = $web.ContentTypes["Project portal"]

$fieldname = "srConsultingEngineer"
$displayname = "Consulting Engineer"
$fieldXML = "<Field Type='Note'  Name='" + $fieldname + "'  Description=''  DisplayName='" + $displayname + "'  Group='Site Request Columns'  Hidden='FALSE' Required='FALSE'  ShowInDisplayForm='TRUE'  ShowInEditForm='TRUE'  ShowInListSettings='TRUE'  ShowInNewForm='TRUE'></Field>"  
$web.Fields.AddFieldAsXml($fieldXML) 
"get created column"
$field = $web.fields.getfield("srConsultingEngineer")
"set group of field"
$field.Group = "Site Request Columns"
"create field link"
$fieldLink = new-object Microsoft.SharePoint.SPFieldLink($field)
"connect fieldlink to contenttype"
$ct.fieldlinks.add($fieldLink)
$ct.update()

This is the website contenttype. Here my new column is available and the inherti option is TRUE. enter image description here

This is the contenttype on the list. Here you do not see the column. enter image description here

What is my issue? Is my powershell script not OK?

1 Answer 1

1

For pushing changes to the children you should specify as

$ct.update($true) 

See the function signature http://msdn.microsoft.com/en-us/library/office/ms475130%28v=office.15%29.aspx

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.