locked
Error Activating Fields and CTypes Features RRS feed

  • Question

  • When I try to run the following script, I receive an error. It looks like the field GUID corresponds to the "ContentType" field that exists on subsites in the site collection. If anyone knows a solution to this error help would be greatly appreciated.

    Enable-SPFeatureCTypes-Urlhttp://portal.askcts.com/solutions/clients

    Enable-SPFeatureFields-Urlhttp://portal.askcts.com/solutions/clients 

    Enable-SPFeature : The field with Id {c042a256-787d-4a6f-8a8a-cf6ab767f12d} defined in feature {ca7bd552-10b1-4563-85b9-5ed1d39c962a} was found in the current site collection or in a subsite.

    At line:3 char:2

    +  Enable-SPFeature CTypes -Url http://portal.askcts.com/solutions/clients

    +  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : InvalidData: (Microsoft.Share...etEnableFeature:SPCmdletEnableFeature) [Enable-SPFeature], SPException

        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletEnableFeature

    Enable-SPFeature : The field with Id {c042a256-787d-4a6f-8a8a-cf6ab767f12d} defined in feature {ca7bd552-10b1-4563-85b9-5ed1d39c962a} was found in the current site collection or in a subsite.

    At line:4 char:2

    +  Enable-SPFeature Fields -Url http://portal.askcts.com/solutions/clients

    +  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : InvalidData: (Microsoft.Share...etEnableFeature:SPCmdletEnableFeature) [Enable-SPFeature], SPException

        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletEnableFeature

    Monday, August 26, 2013 11:44 PM

Answers

All replies

  • You can try this option, Adding the Overwrite="TRUE" attribute on each field definition.

    http://social.msdn.microsoft.com/Forums/en-US/61d992aa-b30e-4a20-a311-ab52efec505a/the-field-with-id-guid-defined-in-feature-guid-was-found-in-the-current-site-collection-or-in-a


    My Blog- http://www.sharepoint-journey.com| Twitter
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful

    • Marked as answer by XantosX5 Tuesday, August 27, 2013 9:41 PM
    Tuesday, August 27, 2013 12:16 AM
  • Hi,

    I would suggest to change the GUID of the field displayed in the error message to a new GUID in field definitions file. This would prevent any undesirable consequences caused due to removal of that field. However, if you are fully aware of that field and need to overwrite it, then you can use Overwrite="TRUE" attribute for that particular field definition.

    Narahari

    ******If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful*******

    Tuesday, August 27, 2013 5:33 AM
  • Thanks for the help guys I appreciate it. One question about changing the GUID. If I change the GUID of the column in the error message, will it break the reference to it in the content types or lists that use the column?

    Tuesday, August 27, 2013 2:15 PM
  • Once you change the GUID, it will be treated as a completely new column. So, If the content type is used elsewhere, this column will be treated as a new addition to the content type. To preserve the references, use the same GUID and the attribute Overwrite="TRUE".

    ******If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful*******

      
    • Marked as answer by XantosX5 Tuesday, August 27, 2013 9:40 PM
    Tuesday, August 27, 2013 4:38 PM
  • I added the overwrite attribute to the field in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\FEATURES\fields\fieldswss.xml , but I still get the error. Am I adding it to the correct place?

        <Field ID="{c042a256-787d-4a6f-8a8a-cf6ab767f12d}"
            Name="ContentType"
            SourceID="http://schemas.microsoft.com/sharepoint/v3"
            StaticName="ContentType"
            Group="_Hidden"
            Type="Computed"
            DisplayName="$Resources:core,Content_Type;"
            Sealed="TRUE"
            Sortable="FALSE"
            Overwrite="TRUE"
            RenderXMLUsingPattern="TRUE"       
            PITarget="MicrosoftWindowsSharePointServices"
            PIAttribute="ContentTypeID">       
            <FieldRefs>
                <FieldRef ID="{03e45e84-1992-4d42-9116-26f756012634}" Name="ContentTypeId"/>
            </FieldRefs>
            <DisplayPattern>
                <MapToContentType><Column Name="ContentTypeId"/></MapToContentType>
            </DisplayPattern>
        </Field>  


    • Edited by XantosX5 Tuesday, August 27, 2013 7:01 PM
    Tuesday, August 27, 2013 6:42 PM
  • I got it activated! I had to set “Overwrite” and “OverwriteInChildScopes” to true on a few fields. Each time I would run the script after setting the attributes I would have to close PowerShell and reopen it for it to give me a different column I needed to Overwrite.

    Thanks for the help guys!

    Tuesday, August 27, 2013 9:40 PM
  • Thanks Guys! solution above saved my life today.
    Friday, June 26, 2015 3:03 PM